Shells aren’t just for running other programs. Bash and Zsh also happen to be powerful programming languages: they have variables, functions, loops, and more. That said, only crazy people write large programs in shell languages… shells are optimized for running other programs and writing small scripts, not for writing large applications in Learn Linux

Creating a Variable

name="Sahil"

Notice there are no spaces between the variable name, assignment operator = and value "Sahil"

Using a Variable

echo $name
Sahil

In shell, we need to use the $ prefix with the variable name to use it otherwise it’ll just print the text “name”

Interpolating a Variable in a String

echo Hello $name
Hello Lane