Process structure

 if the judge

. 1  IF [== $ A $ B]
 2  the then 
. 3      echo  " equal " 
. 4  the else 
. 5      echo  " is not equal to " 
. 6  Fi

 

case branch selection

case $xs in
0) echo "0" ;;
1) echo "1" ;;
*) echo "其他" ;;
esac

 

while loop

. 1 # the while  to true   is equivalent    the while :
 2  # reading documents to read the entire line
 . 3 NUM = . 1 
. 4  the while [$ NUM -LT- 10 ]
 . 5  do 
. 6  echo $ NUM
 . 7 (($ NUM = NUM + 2 ))
 . 8  DONE 
. 9  ## #########################
 10  grep A a.txt | the while Read A
 . 11  do 
12 is      echo $ A
 13 is  DONE 
14  ###### #####################
 15  the while Read A
16 do
17     echo $a
18 done < a.txt 

 

for loop

1  # read file space separated
 2  W = ` awk -F " : "  ' {1} Print $ ' C`
 . 3  for D in $ W 
. 4  do 
. 5      $ D
 . 6  DONE 
. 7  ########### ################
 . 8  for ((I = 0 ; I <O $ {# [*]}; I ++ ))
 . 9  do 
10  echo $ {O [$ I]}
 11  DONE

 

 

until loop

1  # cycle when the command is not 0
 2  an until command   
 . 3  do 
. 4      body
 . 5  DONE

 

Process Control

. 1  BREAK N layers out cycle #
 2  Continue # N cycles out of several layers, the same number of cycles
 . 3 Continue the same number of cycles again #

 

Guess you like

Origin www.cnblogs.com/alog9/p/11532645.html