There are two types of characters in the shell, the ordinary character and metacharacters characters.
You must borrow a reference when you want to remove the special meaning of the metacharacters to restore their literal meaning. There are typically three types of references, escaping, strong references (using single quotes), and weak references (using double quotes).
Strong reference: Any character in a single quotation mark is treated as a normal character, except for the single quotation mark itself. Cannot include single quotation marks in the middle of two single quotes, not with escape.
Weak references: In addition to the double quotes themselves, most of the characters nonalphanumeric as normal. The exception is \, $, ' three special characters, because of the existence of special characters \, so in the middle of the double quotation marks can be escaped to contain double quotation marks. $1 You can use variables
$var 2. Reference arithmetic expression $ (()) 3. command to replace $ ().
About Echo:
BSH: Explains the escape character sequence and cannot be turned off.
Ksh: The default interpretation escape character sequence can be switched off with the-e option.
BASH: The default does not explain the escape character sequence, which can be opened with the-e option.
echo Print Color output:
color code: RESET = 0 Black = 30 Red = 31, green = 32, yellow =33 blue = 34 Magenta =35 cyan = 36 White =37
Echo-e "\e[1;31m This is red text\e[0m"
Environment variables:
Environment variables are generally described in the form of Name=value, separated by a null character (s) from each other. If you change it to \ n, then
You can reformat the output.
Cat/proc/12501/environ | Tr ' + ' \ n '
1. References