|
[test @test test]# vi test12-loop.sh
#!/bin/bash
# Using while and loop
# tonywang 2007/02/06
declare -i i
declare -i s
while [ "$i" != "101" ]
do
s=s+i
i=i+1
done
echo "The count is ==> $s"
上面的:while [ "$i" != "101" ]中的 [ "$" != "101" ] 为什么不可以换成[ "$i" < "101" ]或[ "$i" <= "100" ] ?
请大侠们指教!!谢谢!!! |
|