[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Arithmetic expansion with increments and output redirection
From: |
Greg Wooledge |
Subject: |
Re: Arithmetic expansion with increments and output redirection |
Date: |
Wed, 24 Apr 2019 08:53:04 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
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.
- Arithmetic expansion with increments and output redirection, Ian Neal, 2019/04/23
- Re: Arithmetic expansion with increments and output redirection, Robert Elz, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Ian Neal, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Ilkka Virta, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Greg Wooledge, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Ian Neal, 2019/04/24
- Re: Arithmetic expansion with increments and output redirection, Chet Ramey, 2019/04/24