Single and double quotes
How it works
Single quotes preserve every enclosed character literally; a single quote cannot appear inside a single-quoted region. Double quotes allow variable expansion while preserving spaces and wildcard characters in the resulting ordinary scalar argument. Double quotes also allow some other expansions, which Chapter 4 teaches. Adjacent quoted and unquoted pieces without separating whitespace form one source word. The quote delimiters themselves are not passed to the command.
Run each example separately in a fresh noninteractive Bash script with default options. Tested on Bash 5.2.37 with C locale. Do not enter the prompt or the expected output as code.
Literal or expanded?
Expected stdout (tabs are real characters):
$nameSaraSingle quotes preserve the dollar sign; double quotes let Bash replace the variable reference with its value.
Build one argument
Expected stdout (tabs are real characters):
[prefix-Daily report.txt]Adjacent pieces join into one word. Quoting the variable protects the embedded space.
An apostrophe and literal dollar
Expected stdout (tabs are real characters):
It's readyPrice: $5Use double quotes around the apostrophe and single quotes around a literal dollar amount.
Common mistakes
printf '%s\n' '$name' prints $name, not its value. Conversely, a literal $5 inside double quotes refers to positional parameter 5. Use single quotes for fixed text containing dollar signs. Interactive history expansion can affect ! in double quotes; these examples use noninteractive Bash.
Practice
Set city to New York. Print the literal $city, then the value, then one argument containing Trip: New York!.
Next: Backslashes and ANSI-C quoting