Created
April 20, 2010 06:12
-
-
Save BH1SCW/372114 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
until [ $# -eq 0 ] | |
do | |
echo "第一个参数为: $1 参数个数为: $#" | |
shift | |
done | |
#!/bin/bash | |
if [ $# -eq 0 ] | |
then | |
echo "usage:sumints integer list" | |
exit 1 | |
fi | |
sum=0 | |
until [ $# -eq 0 ] | |
do | |
sum=`expr $sum + $1` | |
shift | |
done | |
echo $sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment