标签:span http bash pre print class nbsp let ash
#! /bin/bash # return sum of arguments let sum=0 for f in $* do sum=$(($sum+$f)) done printf "sum is %d \n" $sum
其中的for循环可以用while替换
while [ $# -ne 0 ] do sum=$(($sum+$1)) shift done
标签:span http bash pre print class nbsp let ash
原文地址:http://www.cnblogs.com/gattaca/p/6146314.html