using /bin/sh vars in awk

Jonathan I. Kamens jik at athena.mit.edu
Mon Apr 29 22:27:14 AEST 1991


In article <MAKI.91Apr29205859 at void.jit.dec.com>, maki at void.jit.dec.com (Watanabe Maki) writes:
|> 	If your awk is nawk(New Awk), it's easy.
|> 	
|> 	... | nawk '{if ($1 == fred) command}' fred="barney"

  Actually, this syntax will work with nearly any version of awk, not just
nawk.  It was available, albeit undocumented, in even the earliest distributed
versions.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710



More information about the Comp.unix.shell mailing list