- Published on
Short engineering note
Subshells vs grouping
- Authors

- Name
- Mehdi Akiki
Note · Engineering notes
(cd /tmp; ls) # runs in subshell, cwd unchanged
{ cd /tmp; ls; } # runs in current shell
Tip: variable changes in subshells do not affect the parent shell.