On Wed, Apr 24, 2019 at 06:47:41AM -0600, Ian Neal wrote: > At what point is a subshell being invoked? There's no pipeline, command > substitution, coprocess, background process, or explicit () subshell here, > which are the only cases a subshell should be created. Otherwise, the > entire operation should be evaluated by the main shell. Arithmetic > expansion is not in that list.
The context got snipped but IIRC it was something like /bin/true > $((n++)) The /bin/true forces the use of an external command, which means a subshell is forked. The redirection occurs in the forked subshell.