执行脚本时候,只是在当前的shell下开了一个子进程,切换目录的操作只对该进程中相关后续指令有效,但改变不了父进程的目录。 解决方法: 法一: 用 source a.sh就行了。 法二: [fedora@localhost ~]$ cd ~ [fedora@localhost ~]$ chmod u+x a.sh [fedora@localhost ~]$ . ./a.sh / comp... Read More
posted @ 2016-04-26 14:57 庚武 Views(4434) Comments(0) Diggs(0) Edit