Bash - Parameter


A variable in bash is called a parameter.

There is three different type of parameter

A parameter can be then referenced by:

  • a name,
  • a number
  • or a special symbol (Special Character)

A parameter is set if it has been assigned a value. (The null string is a valid value)


Check if set

if [ -z ${var+x} ]; then echo "var is unset"; else echo "var is set to '$var'"; fi


Powered by ComboStrap