for loop until loop and IFS separator
for loop
Three for loop formats
while statement
The format of while
Small example
Guess the commodity price game
Obtain a random number through the variable RANDOM
Prompt the user to guess and record the number of times, and exit the loop after the guess
until statement
format of until
Out of the loop
break out of the loop
break out of the two-layer loop
continue to abort a command in a loop, but not completely abort the entire command
IFS field separator
Contains spaces, tabs, and newlines by default
用法
IFSOLD=$IFS
IFS=$(所需要删除的分隔符)
、、、
IFS=$IFSOLD