日期:2014-05-16 浏览次数:20707 次
#!/bin/bash
if [ "$#" == 0 ]; then
echo set default env
elif [ `expr $# % 2` == 0 ]; then
for ((i=1; i<$#; i=i+2)); do
j=`expr $i + 1`
parse_param_list $1 $2
shift 2
done
echo i=$i j=$j
else
echo "incorrect input format"
fi
# !/bin/sh
if [ "$#" == 0 ]; then
echo "set default env"
elif [ `expr $# % 2` == 0 ]; then
array=($*)
for((i=0; i<$#; i=i+2))
do
#parse_param_list $1 $2 #####这里如何使用i j 变量替换,类似实现$1..$n的功能?
echo ${array[@]:i:2}
done
else
echo "incorrect input format"
fi