Ouch! That would take some funky scripting to cover all cases
and deal with bad data, user error.
I suggest that you switch to using C/C++ and using the getopt()
function call or use perl (v5.x) and using GetOpt perl module.
If you insist on using csh, then I suggest that you simplify:
Insist that users pass single options after the dash.
ls -a -l is much easier to deal with in code than
ls -al
However, I have not worked much with csh and little with options,
so my opinion/suggestion may not be worth much.
Sajjad
: Hi,
: I'm trying to write a csh script which will allow the user to put
: switches with arguments on the command line in any order. The command
: would be something like:
: % command -abc 1 -def 2 3 4 -ghijk 5
: Does anyone have a csh routine which will do this?
: Thanks in advance.
: --
: Kevin Reardon
: Turnpike evaluation. For Turnpike information, mailto:i...@turnpike.com