Variables
Store a piece of text and use it again.
A variable is a named box holding a piece of text. Watch the spaces when you make one: there must be NO space either side of the =, or bash thinks you are trying to run a command called name. This trips up absolutely everybody once.
Putting a $ in front of the name means "the value inside the box". Bash swaps $name for Ada before echo ever sees the line, so what echo prints is Hello, Ada!
The box keeps its value, so you can use it as many times as you like. Variables are what make scripts worth writing: a value written once and used in twenty places is a value you can change in one place.
name="Ada"Put text in a box called name.echo "Hello, $name!"Use what is in the box.echo $nameQuotes are optional here, but a good habit.Your task
- ○Make a variable
- ○Print a message that uses it
Open this level in your browser to type the commands at a live terminal that answers back.