shell语法while
来源:互联网 发布:淘宝企业店铺品牌授权 编辑:程序博客网 时间:2024/06/07 00:51
#!/bin/sh
# calculate the sum from 1 to n
# validate the varibles number
if [ $# -ne 2 ] ; then
echo "usage : sum.sh start end"
exit
fi
start=$1
end=$2
while [ $start -lt $end ]
do
sum=$sum+$start
echo "$sum"
start=$start+1
done
echo "the result is $sum"
# calculate the sum from 1 to n
# validate the varibles number
if [ $# -ne 2 ] ; then
echo "usage : sum.sh start end"
exit
fi
start=$1
end=$2
while [ $start -lt $end ]
do
sum=$sum+$start
echo "$sum"
start=$start+1
done
echo "the result is $sum"
- bash shell while语法
- shell语法while
- bash shell while语法
- Shell中while基础语法
- shell-while
- shell ---while
- linux shell学习 记录2 if elif case for while until 语法
- Shell脚本的基本语法(一) if判断、for循环、while循环和until循环
- while循环的语法
- python的while语法
- while语句–shell
- shell-002 while
- shell while循环监控
- do-while in Shell
- for&while loop/shell
- linux shell ----while Loop
- shell脚本:while语句
- shell脚本----while循环
- shell语法function
- NEFU 698 Post office 大概是dp?
- couchbase安装fedora18上的问题
- javascript Table
- 基础加强—06—类加载器
- shell语法while
- UESTC 1817——Complete Building the Houses 贪心
- Eclipse中的快捷键积累
- 下一代网络中的业务融合模式
- MySQL 可以用localhost 连接,但不能用IP连接的问题
- 简明Linux命令行笔记:ls
- NEFU 699 Lucky Boy 博弈?几何?
- STL中的search函数
- 火灾检测模型