C-Shell weirdness

Larry Fitzpatrick lef at nlm-vax.ARPA
Thu Apr 3 03:52:44 AEST 1986


In article <344 at hadron.UUCP> jsdy at hadron.UUCP (Joseph S. D. Yao) writes:

>Your alternative is actually a venerable shell-script idiom to cancel
>the flag effect of the "-".  However, you really should put $arg in
>double-quotes to negate the effect of an in-valid string:
>	set arg = "-b -e"
>	if (x$arg == '-b')
>becomes
>	if (x-b -e == '-b')
>with who knows what syntax error reports.  I'd use:
>	if ("X$arg" == "X-b") ...

if ("$arg" == "-b") echo is sufficient

regards,
fitz
lef at nlm-vax



More information about the Comp.unix.wizards mailing list