Skip to content
Justice Tech School

Variables

Assign with name=value and no spaces around =. Read with $name or ${name}. Names are case sensitive.

Example
name="Ada"
age=30
echo "$name is ${age}"
unset age
echo "age=[${age}]"
readonly PI=3.14
echo $PI

Result

Ada is 30
age=[]
3.14

Exercise

Read a variable.

echo name

Quiz Test

Can there be spaces around = ?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.