条件判断: ------------------------------------------------------------ if test $a -gt 10 或者 if [ $a -gt 10 ] then echo "大于" fi
------------------------------------------------------------- if test $a -gt 10 then echo "大于" else echo "不大于" fi --------------------------------------------------------------- if test $a -gt 10 then echo "大于" elif test $a -eq 10 then echo "等于" else echo "小于" fi
---------------------------------------------------------------- 循环 for num in {1..10} do echo "$num" done
----------------------------------------------------------------- for name in "abc" "tom" "king" "jack" do echo $"name" done -------------------------------------------------------------------