美文网首页
shift命令

shift命令

作者: mirroru | 来源:发表于2020-05-26 19:47 被阅读0次

shift: shift [n]
The positional parameters from $N+1 ... are renamed to $1 ... If N is not given, it is assumed to be 1.

shift 4会将原来的$5变为$1

6.sh内容如下

echo \$1
shift
echo \$1

./6.sh 8 7
输出为

8
7

相关文章

网友评论

      本文标题:shift命令

      本文链接:https://www.haomeiwen.com/subject/umavahtx.html