One, single and double quotation marks
First, both single and double quotes are meant to solve the problem of having spaces in the middle.
The space is used as a typical delimiter in Linux, such as String1=this is a string, so execution will be an error. To avoid this problem, single and double quotes are generated. The difference is that single quotes deprive them of the special meaning of all the characters, while the ' $ ' (parameter substitution) and ' ' (command substitution) in double quotes are exceptions. So, there's basically no difference between the two, unless the parameter substitution $ and the command substitution are encountered in the content.
Look at the following example:
Num=3
Echo ' $num '
$num
echo "$num"
3
If you need to use both symbols in the double quotation mark "", you need to escape with a backslash.
Second, anti-quote "'
The usage of this thing, I Baidu a bit, and $ () is the same. When you execute a command, the statements in either, or $ () are executed once as a command, and the result is added to the original command for re-execution, for example:
echo ' ls '
The LS is executed first to get xx.sh and so on, then replace the original command as:
Echo xx.sh
The result of the final execution is
xx.sh
Well, usually we encounter the output of a bunch of command execution results into a variable, it needs to be enclosed in this command substitution, it is understandable.
There is another problem here, although many system engineers like to use anti-quotes to enclose the command when using the Replace function. However, according to the POSIX specification, a system engineer is required to take the form of a $ (command). So, we'd better follow this specification, less ", more than $ ()
Dragon Blog
http://zhangzhiqiangli.blog.163.com/blog/static/459183842013829113850887/
The difference between a single quotation mark, a double quotation mark, an inverse quotation mark ('), $ () in a Linux shell