Special Parameters
Special parameters holds informations of the current process or the last terminated process:
- $<digit>
- ${<number>}
- Positional parameter are assigned from the shell's arguments when it is invoked, and may be reassigned using the set builtin command. The shift command shifts the parameters FIXME.
- $0
- Special positional parameter: holds the Proccess ID of the current process
- $*
- Expands to the positional parameters, starting from one. It is equivalent to "$1 $2 ..."
Almost every time $@ should be used in place of $*
- $@
- Expands to the positional parameters, starting from one. It is equivalent to "$1" "$2" ...
- $#
- Expands to the number of positional parameters
- $?
- Expands to the exit status of the most recently executed foreground pipeline
- $$
- Expands to the process ID of the shell. In a () subshell, it expands to the process ID of the invoking shell, not the subshell
- $!
- Expands to the process ID of the most recently executed background (asynchronous) command