Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!udel!haven!decuac!bacchus.pa.dec.com!decwrl!brister From: brister@decwrl.dec.com (James Brister) Newsgroups: comp.unix.shell Subject: Re: bourne shell query Message-ID: Date: 30 Aug 90 16:59:33 GMT References: <26DC6447.15922@maccs.dcss.mcmaster.ca> Sender: news@wrl.dec.com (News) Organization: DEC Western Software Lab Lines: 23 In-Reply-To: fred@maccs.dcss.mcmaster.ca's message of 30 Aug 90 00:56:38 GMT X-Checksum-Snefru: 4373a440 1cad1b43 fe27ea12 2d3a6b95 On 30 Aug 90 00:56:38 GMT, fred@maccs.dcss.mcmaster.ca (Fred Whiteside) said: > #!/bin/sh > cd /usr/spool/news/comp/std/c > zots=$1 > echo "Should ignore files with name < $zots" > files=`ls -rt * |grep -v '.*[a-zA-Z].*' | awk $1 '>=' $zots {print}` > echo $files I changed the next to last line to this: files=`ls -rt * |grep -v '.*[a-zA-Z].*' | awk '$1 >= '$zots' {print}'` Awk expects its program to be one argument. You've given it four. You DON'T want the $1 to be expanded, but you DO want the $zots to be expanded, hence the funny quoting. James -- James Brister brister@decwrl.dec.com DEC Western Software Lab., Palo Alto, California. .....!decwrl!brister