KSH script arguments
Jonathan Chang
jonc at uts.amdahl.com
Thu Aug 30 05:54:58 AEST 1990
This is my first visit in this group; hope this is where
all the gurus hang out. I want to pose a somewhat
trivial question:
How can I extract the last argument to a ksh script?
Example:
myscript arg1 arg2 arg3
Within the script, I want to (easily) know the value of 'arg3'.
$# returns the number of arguments, $1 is the first argument,
but what's the variable that cotains the last argument?
Or can someone explain how to get to it (without shifting)?
P.S. Just to add to the challenge, the number of arguments is variable.
Thanks!
jonc at uts.amdahl.com
More information about the Comp.unix.questions
mailing list