getting a field from a line in awk/sed/?

Robert Claeson prc at erbe.se
Wed Jan 16 00:44:16 AEST 1991


In article <1991Jan10.012211.22100 at ux1.cso.uiuc.edu>, gordon at osiris.cso.uiuc.edu (John Gordon) writes:

|> 	Well, this may not be perfect since I don't have an AWK reference
|> right here, but I think this will work:
|> 
|> 	(program that produces output) | awk '{print $2}'

|> 	If that does not work, try this:
|> 
|> 	awk -f <file that contains input> '{print $2}'

The former should work. The latter doesn't work. The -f flag to awk names a
file containing awk code to execute. But using "cut" is even easier (and
requires less typing) than using "awk".
-- 
Robert Claeson                  |Reasonable mailers: rclaeson at erbe.se
ERBE DATA AB                    |      Dumb mailers: rclaeson%erbe.se at sunet.se
Jakobsberg, Sweden              |  Perverse mailers: rclaeson%erbe.se at encore.com
Any opinions expressed herein definitely belongs to me and not to my employer.



More information about the Comp.unix.questions mailing list