Quoting
Double quotes allow variables, single quotes are literal and backslash escapes one character. Always quote variables.
Example
x="a b"
echo "$x" '$x' \$x
files="one two"
for f in $files; do echo "[$f]"; done
for f in "$files"; do echo "[$f]"; doneResult
a b $x $x [one] [two] [one two]
Exercise
Prevent word splitting.
echo "x"
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.