Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Ian Neal
> > "Utilities other than the special built-ins (see Special Built-In > Utilities) shall be invoked in a separate environment that consists of the > following...[includes redirections specified to the utility]...The > environment of the shell process shall not be changed by the utility" > > > http:

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Chet Ramey
On 4/24/19 10:20 AM, Ian Neal wrote: > "Utilities other than the special built-ins (see Special Built-In > Utilities) shall be invoked in a separate environment that consists of the > following...[includes redirections specified to the utility]...The > environment of the shell proce

Re: Escape sequences in vi-ins-mode-string

2019-04-24 Thread Chet Ramey
On 4/23/19 3:54 PM, Joshua O'Connor wrote: > Hi, > > I'm trying to have my cursor change within Bash depending on the vi mode I'm > in. > To accomplish this I've used: > > vi-ins-mode-string = "\1\e[6 q\2" > and a corresponding vi-cmd-mode-string in .inputrc, which has indeed worked. Yes,

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Greg Wooledge
On Wed, Apr 24, 2019 at 09:58:42AM -0400, Chet Ramey wrote: > The SVR4.2 Bourne shell, as another data point, behaves like bash. Since > it doesn't have arithmetic expansion, you have to use something it does > handle internally, like ${n:=2}. I don't know what ksh88, the other POSIX > historical

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Chet Ramey
On 4/24/19 9:49 AM, Ilkka Virta wrote: > On 24.4. 16:37, Chet Ramey wrote: >> "Utilities other than the special built-ins (see Special Built-In >> Utilities) shall be invoked in a separate environment that consists of the >> following...[includes redirections specified to the utility]... > > It do

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Ilkka Virta
On 24.4. 16:37, Chet Ramey wrote: "Utilities other than the special built-ins (see Special Built-In Utilities) shall be invoked in a separate environment that consists of the following...[includes redirections specified to the utility]... It does say "Open files inherited on invocation of the

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Chet Ramey
On 4/24/19 9:07 AM, Andreas Schwab wrote: >> The /bin/true forces the use of an external command, which means a subshell >> is forked. The redirection occurs in the forked subshell. > > But the expansion isn't required to be performed in the subshell. I > don't see POSIX having any wording to r

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Chet Ramey
On 4/24/19 9:22 AM, Ian Neal wrote: > On Wed, Apr 24, 2019, 07:12 Chet Ramey > wrote: > > On 4/24/19 8:47 AM, Ian Neal wrote: > > > At what point is a subshell being invoked? There's no pipeline, command > > substitution, coprocess, background process, or

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Ian Neal
On Wed, Apr 24, 2019, 07:12 Chet Ramey wrote: > On 4/24/19 8:47 AM, 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 crea

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Andreas Schwab
On Apr 24 2019, Greg Wooledge wrote: > 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 b

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Chet Ramey
On 4/23/19 5:49 PM, Ian Neal wrote: > Bash Version: 4.2 > Patch Level: 46 > Release Status: release > > Description: > When using arithmetic expansion with variable pre- and > post-increments/decrements in the output redirection file path, > specifically on external executables (not builtins

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Chet Ramey
On 4/24/19 8:47 AM, 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

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Greg Wooledge
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

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Ian Neal
> Date:Tue, 23 Apr 2019 15:49:18 -0600 > From:Ian Neal > Message-ID: 1_z7uy+7rv...@mail.gmail.com> > > | When using arithmetic expansion with variable pre- and > | post-increments/decrements in the output redirection file path, > | specifically on external execu

Re: Arithmetic expansion with increments and output redirection

2019-04-24 Thread Robert Elz
Date:Tue, 23 Apr 2019 15:49:18 -0600 From:Ian Neal Message-ID: | When using arithmetic expansion with variable pre- and | post-increments/decrements in the output redirection file path, | specifically on external executables (not builtins or functions), the st