[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] scripting foo
- Subject: [ale] scripting foo
- From: fletch at phydeaux.org (Fletch)
- Date: Mon Nov 15 18:40:44 2004
- In-reply-to: <[email protected]> (Jonathan Glass's message of "Mon, 15 Nov 2004 18:42:50 -0500")
- References: <1100558992.2837.18.camel@blue> <[email protected]>
>>>>> "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