[ale] scripting foo

Fletch fletch at phydeaux.org
Mon Nov 15 18:40:44 EST 2004


>>>>> "Jonathan" == Jonathan Glass <jonathan.glass at ibb.gatech.edu> writes:

[...]


    Jonathan> $ cat foo | grep -v RGB | awk {'print $1;'}

*Tweet*  Useless use of cat.  Five yards, repeat the down.

grep -v RGB foo | awk '{ print $1 }'


And before someone tweets me to a taste of my own medicine, note you
don't even need the grep (or whitespace even :) since awk can do the
match internally itself just as well:


awk '!/RGB/{print$1}' zorch


Of course you can do the same with perl just as easily:


perl -lane 'print$F[0]if!/RGB/' zorch


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U



More information about the Ale mailing list