Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!euclid.jpl.nasa.gov!pjs From: pjs@euclid.jpl.nasa.gov (Peter Scott) Newsgroups: comp.unix.questions Subject: How to pass shell variables to awk? Message-ID: <1991Apr8.223119.2318@elroy.jpl.nasa.gov> Date: 8 Apr 91 22:31:19 GMT Sender: news@elroy.jpl.nasa.gov (Usenet) Reply-To: pjs@euclid.jpl.nasa.gov Followup-To: comp.unix.questions Organization: Jet Propulsion Laboratory, NASA/Caltech Lines: 14 Nntp-Posting-Host: euclid.jpl.nasa.gov 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@euclid.jpl.nasa.gov)