next up previous contents
Next: Special Read Only Variables Up: Variables Previous: Global or Environment Variables

Parameters

Parameters (or command line arguments) are shell variables which carry information pertaining to a command line. To reference a parameter, the dollar sign is placed before a number from 0 to 9. The variable $0 is special and refers to the name of the current program which would be csh if $0 was accessed at the command line prompt. While the number after the $ must be 9 or less, higher numbered arguments can be accessed using the $argv[n], where n is a positive integer. To access the 11th command line argument the following variable would be used $argv[11]. The - operator can be used in the same manner as it was for array variables. A shorthand version of the #argv variable is to simply enclose the number in curly braces, ${11}. Parameters may seem strange and useless, but there importance will become evident in the sections on shell programming.



Douglas M Gingrich
Mon Apr 27 15:25:49 MDT 1998