command line options

Guy Harris guy at gorodish.Sun.COM
Sun Apr 10 07:18:17 AEST 1988


> >The first time around I get the right result--a usage message.  The second
> >time, though, the contents of "-x" is dumped in wide format.
> 
> That's because the shell is expanding -? to "-w -x". If there is no
> match, the shell leaves the -? alone.

I think he already knew that - that was his whole point!  He gave a real, not a
hypothetical, case where the shell *will* expand "-?"  to something, rather
than leaving it alone, and therefore where "-?" won't do what it has, on
occasion, been claimed to do.

"-?" is *NOT* guaranteed to give you a usage message, with *ANY* shell, unless
you put it in quotes.



More information about the Comp.lang.c mailing list