自从搜索这个以来,我已经看到了这个答案,但最初我写了这个脚本:
for i in `seq 1 $1`; do cd ../; done;
它不会更改目录。这是为什么,运行为
./updir.sh 5
bash bash-scripting
bash ×1
bash-scripting ×1