until循环中,只有当条件为假时才执行循环体
#!/bin/bash
read COUNT
add=0
until [ $COUNT -lt 1 ]
do
add=`expr $add + $COUNT`
COUNT=`expr $COUNT - 1`
done
echo $add
until循环中,只有当条件为假时才执行循环体
#!/bin/bash
read COUNT
add=0
until [ $COUNT -lt 1 ]
do
add=`expr $add + $COUNT`
COUNT=`expr $COUNT - 1`
done
echo $add