处理用户输入_特殊参数变量_参数统计(2)
#!/bin/bash
# adding command-line parameter
if [ $# -ne 2 ]
then
echo Usage: $(basename $0) parameter1 parameter2
else
total=$[ $1 + $2 ]
echo $1 + $2 is $total.
fi
exit
# ./countparameter2.sh
# ./countparameter2.sh 17
# ./countparameter2.sh i17 25
./countparameter2.sh
./countparameter2.sh 17
./countparameter2.sh i17 25