1 single quotation marks
Single quotation marks can be used to restore the literal meaning of characters, to implement the function of shielding metacharacters, single quotes must be used in pairs
[Email protected]~]# echo ' $JAVA _home '
Special features $JAVA _home #实现屏蔽 $
[[Email protected]~]# echo ' CD \home '
CD \home #实现屏蔽转义字符 \
2 double Quotes
Double quotation marks are basically the same as single quotes, but they do not mask the function of the $ ' \ Three metacharacters, and if you want to block them, you must precede them with a \,
[Email protected]~]# echo "$JAVA _home" #双引号直接输出了变量
/usr/java/jdk1.7.1_8
[Email protected]~]# echo "It s your book"
It ' s your book
[[Email protected]~]# echo ' \ $JAVA _home ' #用 \ Escape, output the following characters directly
$JAVA _home
3 anti-Quote
Reverse quotation marks are command substitution, replacing command characters with command result output
[Email protected]~]# echo "Today is ' Date '" #直接输出date命令的结果
Today is Fri Dec 11:50:20 CTS 2016
This article is from the "Practical Linux knowledge and Skills sharing" blog, please be sure to keep this source http://superleedo.blog.51cto.com/12164670/1887616
Shell quotes are useful