shell variable

A named value stored in the current shell, set with name=value and read back with $name.

In more detail

There must be no spaces around the equals sign, or bash treats the name as a command. A shell variable belongs to the shell process that set it and is not passed to programs it runs unless exported. All values are strings; arithmetic contexts read them as numbers.

Examples

city=London
echo "$city"

Related terms

Taught in

References