bourne shell query
Scott Yelich
scott at tab00.larc.nasa.gov
Fri Aug 31 02:49:30 AEST 1990
>:>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 <game-design-request at cs.odu.edu>
ODU/UNIX/BSD/X/C/ROOT/XANTH/CS/VSVN/
-----------------------------------------------------------------------------
More information about the Comp.unix.shell
mailing list