[prev] [index] [next]

Shell Scripts (cont)

Some shell built-in variables with pre-assigned values:
$0 the name of the command
$1 the first command-line argument
$2 the second command-line argument
$3 the third command-line argument
$# count of command-line arguments
$* all of the command-line arguments (together)
$@ all of the command-line arguments (separately)
$? exit status of the most recent command
$$ process ID of this shell
The last one is useful for generating unique filenames.