Special parameters

Authors

Marie-Hélène Burle

Alex Razoumov

A number of special parameters, all starting with $, get expanded by Bash.

Example:

function arguments {
    echo First argument: $1
    echo Second argument: $2
    echo Third argument: $3
    echo Number of arguments: $#
    echo All arguments: $@
}

arguments one two three four five
First argument: one
Second argument: two
Third argument: three
Number of arguments: 5
All arguments: one two three four five

Additionally, !! is replaced by the previous command.