Three LINUX flow control statement formats

if judgment statement:
if [conditions that need to be judged] //Pay attention to the format of the space
then
execute the statement
else
execute the statement
fi
//Indicates the end

for loop statement:
for variable name in value list // such as for UNAME in 'cat users.txt' and for IP in $HLIST
do
command sequence
done
// end the loop

while loop statement:
while loop condition // while true means infinite loop
do // start loop
exit 0 // reach the qualified condition, exit loop
done // end loop

case condition test statement:
case conditions to be judged in
[az] | [AZ] )//mode 1
execution statement
;;
[0-9])//mode two
execution statement
;;
*)//other modes
execution statement
esac //End condition test statement

let TIMES++ //Add 1 to the TIMES parameter

Guess you like

Origin blog.csdn.net/weixin_41407439/article/details/90708353