Skip to content

Instantly share code, notes, and snippets.

@BH1SCW
Created April 20, 2010 06:12
Show Gist options
  • Save BH1SCW/372114 to your computer and use it in GitHub Desktop.
Save BH1SCW/372114 to your computer and use it in GitHub Desktop.
#!/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