There are single quotation marks, double quotation marks, and back quotation marks in the shell, each of which is used differently. Here is a summary of the use of quotation marks in the shell
Single quotes
str='this is a string'
Single-quotation string features:
- Any character in a single quote is printed as it is. Variables in a single quote string are invalid.
- A single quote cannot appear in a single quote string (even if you use an escape character for a single quote).
Double quotation marks
myname='Yuan'
str="My name is \"$myname\"! \n"
Features of double quotation marks:
- You can have variables in double quotes
- Escape characters can appear in double quotation marks
The quotation marks
line = `sed -n '/string/=' test.txt | sed -n "1"p`
echo $line
The purpose of the backquotes is to store the result of many commands in a variable