> Why would I want a shell script to change my $CWD after the shell script exits?
If you called the script with the intent that it change your $CWD, obviously.
The solution, of course, is to source the script rather than executing it. This is mentioned in the article, but requires an understanding (at least a minimal one) of subshells to get why - which is precisely what the article addresses.
If you called the script with the intent that it change your $CWD, obviously.
The solution, of course, is to source the script rather than executing it. This is mentioned in the article, but requires an understanding (at least a minimal one) of subshells to get why - which is precisely what the article addresses.