How to pass shell variables to awk?

Peter Scott pjs at euclid.jpl.nasa.gov
Tue Apr 9 08:31:19 AEST 1991


Maybe this one should be in the FAQ; I know it came through here
several months ago, but I forgot the answer until, of course, I
wanted to do it myself.

Now I have a workaround, so I'm interested in the answer only
for academic reasons (until I need to do it again...); if I have
some (csh) variable foo and I want awk to recognize it, e.g.
awk file '{print $1-?$foo?}', what would I use instead of ? and ? ?
Thanks!


-- 
This is news.  This is your       |    Peter Scott, NASA/JPL/Caltech
brain on news.  Any questions?    |    (pjs at euclid.jpl.nasa.gov)



More information about the Comp.unix.questions mailing list