re: BASH tricks: The dir stack. VIEW POST


Another handy trick is to shove everything into a subshell. Doesn't work for everything, especially if you want to pass variables around, but for quick things that need to run in a particular directory without affecting the script state, this:

(cd output/day1 &&summaryTool -q -v)

does it all for you.

code of conduct - report abuse