First page Back Continue Last page Overview Graphics
Scripts, cont'd
A special variable called argv is defined inside a script (shell). It contains any arguments passed to the script (shell).
- E.g. echo $argv [show all arguments]
- echo $argv[2] [show the 2nd argument]
- echo $#argv [show the number of args]
You can do integer math within a script using @.
- E.g. set x = 0; @ x = $x + 1; echo $x [good for loops!]
Notes: