How to get the C-shell to recognize -?
Ken Turkowski
ken at turtlevax.UUCP
Sat May 11 02:47:10 AEST 1985
In trying to make my shell scripts understand a standard help inquiry,
I would like to have the csh recognize the flag "-?" , so that one might say:
gobble -\?
and have it echo:
gobble takes the flags:
-v Verbose
-o <outfile> Output is directed to <outfile> rather than the default
-? Prints this help message
...
I have done this easily with sh, but csh is very stubborn. I have tried
switch ("$flag")
case
case -?:
case '-?':
case -\?:
case "-?":
case "-\?":
case "-\\?":
case "-\\\?":
case "-\\\\?":
case "-\\\\\?":
case '-?':
case '-\?':
case '-\\?':
case '-\\\?':
case '-\\\\?':
case '-\\\\\?':
endsw
and none of them will match. So I offer this problem as a puzzle to the
Unix community (including Bill Joy, the author).
--
Ken Turkowski @ CADLINC, Menlo Park, CA
UUCP: {amd,decwrl,hplabs,nsc,seismo,spar}!turtlevax!ken
ARPA: turtlevax!ken at DECWRL.ARPA
More information about the Comp.unix
mailing list