Variables & output
A Bash script is nothing more than a list of commands saved in a file. Instead of typing them one at a time, you write them down once and let the shell run them top to bottom: the same commands you'd type by hand, just automated. That's the whole idea behind every deploy script, backup job and CI step you'll ever touch.
Before you write one, two ideas need to be rock solid: variables and output. In
each step you write your script in the editor and press Run; it runs with bash in
the sandbox, and the console shows whatever it printed.
Interview prep
Bash quoting is a rite of passage.
Why double quotes around "$name" instead of single quotes?
Double quotes expand variables (and command substitution) while still protecting against word-splitting on spaces. Single quotes are fully literal — '$name' prints the text $name.