' | $ echo '$PWD' $PWD $ echo '\$PWD' \$PWD |
| The single quote (')
protects everything enclosed between two single quote marks except
the single quote itself. That is, only the single quote can't be
protected; all other metacharacters have no special meaning inside
single quotes. |
" | $ echo "$PWD" /users/mary $ echo "\$PWD" $PWD |
| The double quotes allow parameter and
command substitution. The \,
inside double quotes, quotes the characters \,
', ",
and $ rather
than the shell evaluating them. This example echos the path name
contained in the variable PWD.
When the \ is
placed in front of the $,
the echo cannot
evaluate PWD. |