1. Double quotes
Double quotes allow expansion, so $name becomes its value.
echo "double $name"Typorithm · medium
Step 1 of 8 · intro card
Basics
Double quotes allow $variable expansion; single quotes are fully literal. ${var:-default} supplies a fallback when var is unset, arr=(*.txt) builds an array from a glob, and ${#arr[@]} returns the array's length.
Quoting controls expansion. Double quotes ("double $name") let the shell expand variables and command substitutions, while single quotes ('single $name') are completely literal — nothing inside is expanded.
${name:-guest} is parameter expansion with a default: if name is unset or empty, guest is used instead, otherwise the variable's value wins. It is the standard way to give a fallback.
files=(*.txt) creates an array by letting the shell expand the *.txt glob into matching filenames, and ${#files[@]} reports how many elements the array holds.
Double quotes expand; single quotes are literal.
${var:-default} falls back when var is unset or empty.
arr=(*.txt) builds an array; ${#arr[@]} is its length.
echo "double $name"
echo 'single $name'
echo "${name:-guest}"
files=(*.txt)
echo "${#files[@]}"Connect each part of the code to the concept before you type.
Double quotes allow expansion, so $name becomes its value.
echo "double $name"Single quotes are fully literal — $name is printed verbatim, no expansion.
echo 'single $name'${var:-default} substitutes the default when var is unset or empty.
${name:-guest}arr=(...) makes an array; *.txt is a glob the shell expands into matching filenames.
files=(*.txt)${#arr[@]} gives the number of elements in the array.
${#files[@]}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.