3 ms·
> Subshells are, as the name suggests, running in a subshell. They don't strictly have to be OS subprocesses Are there really cases where subshells are invoked
by barosl 5y ago
> Subshells are, as the name suggests, running in a subshell. They don't strictly have to be OS subprocesses
Are there really cases where subshells are invoked within the same process? In my experience, it has never been the case. That's why I've been trying to minimize the use of subshells because spawning a new process is a bit slow.
- cryptonector 5y agoWhile it's probably true that subshells don't strictly have to fork(), I'm willing to bet Bash does it every time and never optimizes away the fork().