Variables

During the execution of a program, a process must keep values in memory. To do this, it uses variables.

Under bash, the assignment of a value to a variable is done by the operator =.

i="toto"
j=2
k=3.6

To obtain the value of a variable, one must use the $ prefix.

echo $i
echo $j
echo $k

To avoid confusion in names, it is best to surround the name of a variable with braces:

ij=314
echo $i
echo $j
echo $ij
echo $i$j
echo ${ij}
echo ${i}${j}
echo ${i}j

By default, a non-initialized variable is empty:

echo $ijk