shell syntax(1)

The difference between several loops:
until loop, as long as the specific condition is false, the until statement will be executed.
The while loop will execute the
for loop as long as the specified condition is true. The “for” loop always receives a certain type of word list after the “in” statement.
The meaning of i++ is actually i+1
double parentheses:
1. echo $((16#5f)) The result is 95 (hexadecimal to decimal)
2. Redefine the variable value, such as a=5; ((a++)) Yes Redefine $a as 6
numerical comparison parameters:
Is equal to the [-eq]
Greater than or equal to [-ge]
Is greater than [-gt]
Less than or equal to [- le]
Less than [-lt]
Is not equal to [-ne]
Greater greater than greater
equal equal to equal
less less
than than
read Command function:
read a line from standard input, and put each line of input The value of each field is assigned to the shell variable
parameter:
-a followed by a variable, the variable will be considered as an array, and then assign a value to it, the default is to use a space as the separator.
-d is followed by an identifier. In fact, only the first character after it is useful. As a sign of the end, an example will be given.
-p is followed by prompt information, that is, the prompt information is printed before input.
-e Command completion function when inputting.
-n is followed by a number to define the length of the input text, which is very practical.
-r Shield. If there is no such option, it will be used as an escape character. If there is, it will be a normal character.
-s Quiet mode, no longer display on the screen when entering characters, such as entering a password when logging in.
-t followed by the number of seconds, defines the waiting time for input characters.
-u followed by fd, read from the file descriptor, which can be newly opened by exec.
-z judge the value of the variable, whether it is empty; zero = 0

Guess you like

Origin blog.51cto.com/14954090/2540791