You are viewing a single comment's thread from:
RE: Bash Script Examples (Directory Navigation)
I did not know about the subshell. Seems useful, will have to try it out!
Push/pop I also know about but haven't gotten into the habit of using though I do occasionally.
I was actually considering a more in-depth explanation of sub shells would be a good topic for another post. Because along with
()
there is also$()
and `` and <() andstuff | otherstuff
that all end up invoking sub shells... and while I'm at it, here-docs might fit in there, too, as you can do stuff likebash << EOF
bash <<< stuff
...I almost always forgot to popd after I pushd... I generally end up
cd -
ing...Same same. I definitely use $() a lot.
Have you gone over piping in one of your posts yet? Somehow I was just reminded of it and it's one of the most common things I use for scripting tasks. Must be must be...
I've referenced it a little bit when talking about while loops, but I haven't devoted much attention to it. I think between subshells and piping I've more than enough to fill another article.