[问题] 怎样修改$1,而不改变$2, $3, ...?

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
5451vs5451
帖子: 345
注册时间: 2006-07-14 18:56
来自: Apple Valley, Planet Tux, Linux System

[问题] 怎样修改$1,而不改变$2, $3, ...?

#1

帖子 5451vs5451 » 2006-09-22 14:36

用set $new1的话, $2, $3, ...的值就没有了。
头像
5451vs5451
帖子: 345
注册时间: 2006-07-14 18:56
来自: Apple Valley, Planet Tux, Linux System

#2

帖子 5451vs5451 » 2006-09-22 23:22

找到一种办法
shift
set "$new1" "$@"
回复