Shell quoting problem. Passing a "?" parameter.

Robert Hartman rhartman at thestepchild.sgi.com
Sat May 11 08:01:36 AEST 1991


In article <1141 at cracklin.oat.bran.gnu.ai.mit.edu> pfalstad at phoenix.princeton.edu (Paul Falstad) writes:
>root at lingua.cltr.uq.OZ.AU (Hulk Hogan) wrote:
>>% sh
>>$ dm()
>>{
>>$*
>>}
>
>dm()
>{
>"$@"
>}
>
>>$ ls ?
>>1    4
>>$ dm "echo ?"
>>1 4
>
>$ dm "echo ?"
>?
>$ ...

In sh, if filename expansion fails, the pattern is taken as a literal,
so in Paul's example (the second above), there must not have been any
1-character filenames in the working directory.  I'm not sure how to
turn of globbing (filename expansion) in the Bourne shell, but that's
what needs to be done for this to work reliably.

Anybody recall how to do that?

-r



More information about the Comp.unix.shell mailing list