The function of quotation marks
1 double quotation marks ("")
1) Use "" To reference any character or string except the character $ (dollar sign), ' (anti-quote), \ (backslash). Double quotation marks do not prevent the shell from special handling of these three characters (flag variable name, command substitution, backslash escape).
EG:NAME=GEZN; echo "User name: $name"//will print User NAME:GEZN
Echo "The date is: ' Date +date-%d-%m-%y '"//will print the date is:03-05-2009
Echo–e "$USER \t$uid"//will print GEZN 500
2) If you want to find new strings that contain spaces, you often use double quotes
2 single quotes (')
1) If you enclose the string in single quotation marks, the special meaning of any special character in the string within the Dayi9nhao is masked.
2) example: Echo–e ' $USER \t$uid '//will print the $user $UID (no shield \ t, because of the option "-e")
Echo ' User\t$uid '//will print $user\t$uid
3 anti-quote (')
1) the shell takes the contents of the inverted quotation mark as a system command and executes its contents. Use this method to replace the output to a variable
2) Example: a= ' date + date-%d-%m-%y '//will print the date is:03-05-2009
4. backslash (\)
1) If the next character has a special meaning, the backslash prevents the shell from misunderstanding its meaning, that is, shielding its special meaning.
2) subordinate characters contain special meanings:& * + $ ' "| ?
3) to add octal characters (ascii corresponding characters) when printing a string, you must precede it with a backslash, or the shell will be a normal number.
Example: bj=beijing; echo "variable\ $BJ = $BJ"//will print variable $BJ = Beijing
The effect of quotes in the shell (GO)