Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!abcfd20.larc.nasa.gov!tab00.larc.nasa.gov!scott From: scott@tab00.larc.nasa.gov (Scott Yelich) Newsgroups: comp.unix.shell Subject: Re: bourne shell query Message-ID: Date: 30 Aug 90 16:49:30 GMT References: <26DC6447.15922@maccs.dcss.mcmaster.ca> <8446@orca.wv.tek.com> Sender: news@abcfd20.larc.nasa.gov (USENET File Owner) Organization: NASA Langley Research Center, Hampton, Va. 23665 Lines: 28 In-Reply-To: jeff@quark.WV.TEK.COM's message of 30 Aug 90 14:55:44 GMT >:>files=`ls -rt * |grep -v '.*[a-zA-Z].*' | awk $1 '>=' $zots {print}` >I see a quoting problem here ^^^^^^^^^^^^^^^^^^^^^ >files=`ls -rt * |grep -v '[a-zA-Z]' | awk "\$1 >= $zots {print}"` >To explain: > The only real change was to change thw quoting around the awk script. >$1 was getting expanded to the shell's $1, not the 1st awk field. > By using " as a quoting character, the shell is able to expand $zot >to whatever number it represents. The \$1 is to prevent the shell >from trying to expand $1 to the shell's $1, rather than the 1st awk >field. I still see a quoting problem here... At least, when I try this-- it doesn't work. I have only been able to get awk to work properly if I use single quotes and not double quotes. As a side question, does ANYONE have any bourne shell routines which do math... reasonably effeciently? (For numbers > 1000?) -- Signature follows. [Skip now] ----------------------------------------------------------------------------- Scott D. Yelich scott@[xanth.]cs.odu.edu [128.82.8.1] After he pushed me off the cliff, he asked me, as I fell, ``Why'd you jump?'' Administrator of: Game-Design requests to ODU/UNIX/BSD/X/C/ROOT/XANTH/CS/VSVN/ -----------------------------------------------------------------------------