> Nested quotations

> A very confusing problem is placing quotation marks within quotation marks. It can be done, but it is not always consistent or logical. Quoting a double quote is perhaps the simplist, and does what you expect. These commands each output a double quote:

echo '"'
echo "\""
echo \"

> The backslash is different. Look at the three ways to output a backslash:

echo '\'
echo "\\"
echo \\

> As you can see, single quotes and double quotes behave differently. A double quote is weaker, and does not quote a backslash. Single quotes are different again. You can escape them with a backslash, or quote them with double quotes:

echo \'
echo "'"

> The following does not work:

echo '\''

> It is identical to

echo '

> Both examples start a quoting operation, but do not end the action. In other words, the quoting function will stay toggled, and will continue until another single quote is found. If none is found, the shell will read the rest of the script, until an end of file is found.
