【发布时间】:2018-01-19 03:30:15
【问题描述】:
我在一个名为 /Users/tcl/scripts/gotoroot 的文件中有这个脚本:
echo "hello"
cd /
echo "good bye"
但是当我运行它时,我得到了这个:
User:scripts tcl$ pwd
/Users/tcl/scripts
User:scripts tcl$ gotoroot
hello
good bye
User:scripts tcl$ pwd
/Users/tcl/scripts
User:scripts tcl$
目录没有变,不知道为什么?它应该是 /,而不是 /Users/tcl/scripts
【问题讨论】:
标签: bash