subshells
A subshell is a separate instance of a shell that executes a command sequence as a child process of the current shell. Subshells have their own process ID and memory space but inherit the parent’s environment at the moment of creation. They allow isolated changes to variables and the working environment without affecting the parent shell.
Subshells are commonly created in several ways. In many shells, parentheses group commands and run them in
Environment and side effects: because a subshell is a separate process, it receives a copy of the
Differences and alternatives: if the goal is to group commands without creating a new subshell, many shells
Examples: (cd /var/log; ls) runs in a subshell, so the parent shell’s current directory remains unchanged. VAR=1;