From Shell13 asked
-E: Activate the conversion of the backslash control character (refer to the following table)
-e: Turn off anti-skew control character conversion (preset)
-N: Cancel line end of line symbol (with the \c character under the-e option)
To cancel a variable, you can use the unset command in bash to handle it:
Code: unset A
For EP:A=BCD
Echo $a
Unset $a
Variable set mode str not set STR has been set whether it is not an empty string
VAR=${STR=EXPR} str=expr Str invariant
var=expr var= $str
VAR=${STR:=EXPR} Whether or not Str has a definition, it will be redefined to assign a value
$# 是传给脚本的参数个数
$
0
是脚本本身的名字
$
1
是传递给该shell脚本的第一个参数
$
2
是传递给该shell脚本的第二个参数
[email protected] 是传给脚本的所有参数的列表
$* 是以一个单字符串显示所有向脚本传递的参数,与位置变量不同,参数可超过
9
个
$$ 是脚本运行的当前进程ID号
$? 是显示最后命令的退出状态,
0
表示没有错误,其他表示有错误
In the last two echo commands, you will find that the argument part is displayed in your fluorescence screen, and the line break
There is no difference between the "-n" option.
Obviously, the second echo is canceled by the line break, and the next shell prompt is connected to the
The results of the same line ... ^_^
In fact, Echo, in addition to the-N options, has the following common choices:
7-E: Activate the inverse of the control character conversion (refer to the following table)-e: Close the inverse of the control character conversion (this is the case)-N: Cancel line end of the line symbol (with the-e option under the \c character consent)
The following table lists the anti-skew control characters supported by the echo command:
\a:alert/bell (from the system speaker)
\b:backspace, that is, to the left to remove keys
\c: Cancel line end of line break
\e:escape, jump Keys
\f:formfeed, page character
\n:newline, replacing line characters
\r:return, back to the car keys
\t:tab, table-hopping keys
\v:vertical TAB, Vertical table-hopping keys
\N:ASCII Eight Import code (16-bit X first)
\ \: The backslash itself (tabular information from O ' Reilly publishing house learning the Bash Shell, 2nd Ed.)
Shell Basic Learning