From: http://www.lampchina.net/article/htmls/200903/MjE4Njk1.html
Function of quotation marks
1Double quotation marks ("")
1) Use""Referable except characters$ (Dollar sign),`(Reverse quotation marks ),/Any character or string outside (backslash. Double quotation marks are not blockedShellPerform special processing on the three characters (variable name, command replacement, and backslash escape ).
Example:
Name = gezn; echo "User name: $ name "//PrintUser name: gezn
Echo "The date is: 'date + date-% d-% m-% y '"//PrintThe date is:03-05-2009
Echo-e "$ USER/t $ UID "//PrintGezn 1, 500
2) Double quotation marks are frequently used for searching strings containing spaces.
2Single quotes ('')
1)If a string is enclosed in single quotesDayi9nhaoThe special meanings of any special characters in the string are blocked.
2)Example:
Echo-e '$ USER/t $ uid '//Print$ USER $ UID (Not blocked/T,Because the option"-E")
Echo 'user/t $ uid '//Print$ USER/t $ UID
3Back quotes ('')
1)ShellUse the content in the quotation marks as a system command and execute the content. This method can replace the output with a variable.
2)Example:
A = 'date + date-% d-% m-% y '//PrintThe date is:03-05-2009
4Backslash (/)
1) If the next character has a special meaning, the backslash preventsShellMisunderstanding its meaning, that is, shielding its special meaning.
2) Subordinate characters have special meanings:& * + $ '|?
3)Add the octal character (ASCIIThe backslash must be added to the front. OtherwiseShellAs a common number.
Example:
Bj = Beijing; echo "variable/$ bj = $ bj "//PrintVariable $ bj = beijing