Changing a directory of the parent shell [duplicate]
问题 This question already has answers here : Why doesn't “cd” work in a shell script? (29 answers) Closed last year . I 'm wondering of any mechanism that one could use to change the directory of a parent shell from sub-shell. For ex., I 'm running the script "settings.sh" in my $HOME. My $HOME has a directory $HOME/TEST/run. If my "settings.sh" scripts is as below #!/bin/bash # some shell related code # some shell related code cd $HOME/TEST/run exit 0 I execute the above script at command prompt