Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!tgr!jra@BRL-VAT.ARPA From: jra@BRL-VAT.ARPA (VLD/ATB) Newsgroups: net.unix Subject: Re: How to get the C-shell to recognize -? Message-ID: <10613@brl-tgr.ARPA> Date: Mon, 13-May-85 09:11:25 EDT Article-I.D.: brl-tgr.10613 Posted: Mon May 13 09:11:25 1985 Date-Received: Thu, 16-May-85 03:21:59 EDT Sender: news@brl-tgr.ARPA Lines: 33 >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 Output is directed to 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 "-?": . . . > endsw >and none of them will match. So I offer this problem as a puzzle to the >Unix community (including Bill Joy, the author). >-- Try this: set noglob switch ( $FLAG ) case "-?": . . . endsw unset noglob