I noticed that the author uses cmd.exe in one of the charts. I wonder if this is a stumbling point for people moving to linux. As it is none of this surprised me or needed any explanation.
Why would I want a shell script to change my $CWD after the shell script exits?
Why would I want a shell script to change my $CWD after the shell script exits?
Maybe you wanted a script that would use shortcuts to take you to cumbersome directory paths?
I enjoyed this article, even though some of it was review. I didn't know that anything in a pipeline got its own separate subshell in bash, and that different shells behaved differently in that regard. I'm always happy to learn interesting uses for process substitution, and got a kick out of:
> 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.
Why would I want a shell script to change my $CWD after the shell script exits?