Double Vs. Single Quotes

Shell variables (e.g. $PATH) are treated as simple strings when wrapped in single quotes but as variables when wrapped in double quotes.

Write The Shell Script

#!/bin/sh

# Print a string surrounded in single quotes
echo 'Single Quotes: $PATH'

# Print a string surrounded in double quotes
echo "Double Quotes: $PATH"

Run The Shell Script

sh quotes.sh
Single Quotes: $PATH
Double Quotes: /home/chris/anaconda3/bin:/home/chris/anaconda3/condabin:/home/chris/.local/bin:/home/chris/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin#!/bin/sh