On 5/24/16 1:41 AM, Dan Douglas wrote:
>> You don't precede it with an `exec', so it doesn't affect the current
>> shell. So-called `null' commands with redirections are executed in
>> subshells. This is where you need the `exec'.
>
> I know POSIX allows for a subshell but don't know what the point is. I
> was confused by this when I first hit it. The subshell isn't obvious.
It's not that Posix `allows' a subshell, it requires a subshell
environment:
"If there is no command name, any redirections shall be performed in a
subshell environment."
Bash produces a subshell environment by creating a subshell.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/