1. shift 命令的用法
shitf的作用是用来对位置参数左移,一般对脚本的参数位置进行左移;
shift 3 #把参数进行左移3个,$4 --->$1
#/bin/bash
#echo -e "./t.sh arg1 arg2 arg3 arg4 arg5 arg6"
str1="${1},${2},${3}"
echo "str1=$str1"
shift 3
str2=$@
echo "str2=$str2"
sh t.sh 1 2 3 4 5 6 7
str1=1,2,3
str2=4 5 6 7