
command line args and 'if'
Hi,
I am writing a csh script, and want to have an optional command line
argument in the form '-argument'.
Basically I want the usage to be: script [-d] filename
Now the problem I have is that in the script, the 'if' statement does
not seem to like the '-' in the $1 variable (i.e. the script breaks
with a 'if expression syntax error' is there is a '-' in the
appropriate argument)
How would people suggest I get around it? Is there some way to escape
the '-' (not while invoking the script)?
Remember the -d is optional.
thanks for any help,
Kevin
--
------------------------------------------------------------------------------
Kevin Mocklin __/ __/ __/__/ __/ __/ __/__/__/ __/ __/
mock...@twain.ucs.umass.edu __/__/ __/ __/__/ __/ __/__/__/
University of Massachusetts __/ __/ __/__/ __/ __/__/__/ __/ __/
------------------------------------------------------------------------------