Bash - Parameter

About

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)

Management

Check if set

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

where


Powered by ComboStrap