1. Assignment
Assign with no spaces around = — name="Ada", never name = "Ada".
name="Ada"Typorithm · easy
Step 1 of 8 · intro card
Basics
Assign variables with name=value (no spaces around =), expand them with $name or ${name}, run commands inline with $(...), make constants with readonly, and share variables with child processes via export. Quote values to keep spaces.
A bash variable is set with name=value and read back with $name. The assignment must have no spaces around the = sign — name="Ada" works, name = "Ada" does not.
Inside double quotes, $name (or the explicit ${name} form) expands to the value, while $(...) is command substitution: it runs the command and drops its output in place, like $(date +%F) for today's date.
readonly turns a variable into a constant that cannot be reassigned, and export marks a variable so child processes inherit it in their environment. Always quote values that may contain spaces.
name=value — no spaces around the = sign.
$name / ${name} expand a variable; $(...) substitutes command output.
readonly makes a constant; export shares a var with child processes.
name="Ada"
echo "Hi $name"
echo "Today: $(date +%F)"
readonly PI=3.14
export PATH="$HOME/bin:$PATH"Connect each part of the code to the concept before you type.
Assign with no spaces around = — name="Ada", never name = "Ada".
name="Ada"$name (or ${name}) expands to the variable's value inside double quotes.
echo "Hi $name"$(...) runs a command and substitutes its output into the line.
$(date +%F)readonly makes a variable a constant that can no longer be reassigned.
readonly PI=3.14export puts a variable in the environment so child processes inherit it.
export PATH="$HOME/bin:$PATH"Read the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.