sh Quoting Single-Quotes


Example

Single-quotes are literal strings, and the lack of escape characters means that the only character that can not occur inside of a single-quoted string is a single-quote.

$ echo '$var \$var \\$var \\\$var'
$var \$var \\$var \\\$var
$ echo '"quoted string"'
"quoted string"
$ echo 'var=$(echo $var)'
var=$(echo $var)