#!/bin/bash
#Program:
# Program shows the script name, parameters
#History:
# 2013/08/26
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
echo "The script name is ==> $0"
echo "Total parameter number is ==> $#"
[ "$#" -lt 2 ] && echo "The number of parameter is less than 2. Stop here." \
&& exit 0
echo "Your whole parameter is ==>$@"
echo "the 1st parameter ==> $1"
echo "the 2nd parameter ==>$2"
#!/bin/bash
#Program:
# Program shows effect of shift function
#History:
# 2013/08/26
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
echo "Total parameter number is ==> $#"
echo "Your whole parameter is ==>$@"
shift #进行第一次“一个变量的shift”
echo "Total parameter number is ==> $#"
echo "Your whole parameter is ==>$@"
shift 3 #进行第一次“一个变量的shift”
echo "Total parameter number is ==> $#"
echo "Your whole parameter is ==>$@"