case 语法
#!/bin/bash
read -p “请输入yes/no” flag
case $flag in Yes | y* | Y*)
echo “输入了yes”
;;
no | n* | N*)
echo "输入了no"
;;
*)
echo "输入了其它"
esac
循环:for while until
for 循环
#!/bin/bash
declare -i i=0
declare -i sum
case 语法
#!/bin/bash
read -p “请输入yes/no” flag
case $flag in Yes | y* | Y*)
echo “输入了yes”
;;
no | n* | N*)
echo "输入了no"
;;
*)
echo "输入了其它"
esac
循环:for while until
for 循环
#!/bin/bash
declare -i i=0
declare -i sum