Incoming from Nick W:
> On May 15, 2004 05:32 pm, s. keeling wrote:
> >
> > Change that "print $1" to "print $1 * 2" and you'll see the echo is
> > just swallowed, the "print" is what's producing output, and changing
> > the ";" to an "|" swallows everything.
> 
> ok, but why? Why is it swallowed when I pipe it into echo, but works correctly 
> when piped into sort? A different but similar example, lets say I wanted to 

You're going to have me digging out my O'Reilly sed & awk book any
minute now.  My guess is echo is a command external to awk, so piping
it to echo was probably a dumb idea on my part.  Sorry.

> remove all the backup files from a given directory...
> 
> ls -la | awk 'BEGIN {ORS=" "} $9 ~ /~/ {print $9}'

Offhand, I'd say you're getting into system interaction stuff here.
Does awk have a system() function?  I can't remember.  If so,
"{system(/bin/rm $9)}" might do what you want.


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*)               http://www.spots.ab.ca/~keeling 
- -

_______________________________________________
clug-talk mailing list
[EMAIL PROTECTED]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca

Reply via email to