Re: nofork command substitution

2023-05-19 Thread Chet Ramey
On 5/18/23 10:14 PM, Dale R. Worley wrote: Chet Ramey writes: Bash allows the close brace to be joined to the remaining characters in the word without being followed by a shell metacharacter as a reserved word would usually require. I had to read this a couple of times to figure out what it

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
On Fri, May 19, 2023, 14:55 Greg Wooledge wrote: > On Fri, May 19, 2023 at 02:25:15PM +0200, alex xmb ratchev wrote: > > On Fri, May 19, 2023, 13:54 Greg Wooledge wrote: > > > > > On Fri, May 19, 2023 at 01:36:44PM +0200, alex xmb ratchev wrote: > > > > 'C ..' > > > > ' ..' > > > > '| ..' > > >

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
hello .. On Fri, May 19, 2023, 16:29 Chet Ramey wrote: > On 5/18/23 10:14 PM, Dale R. Worley wrote: > > Chet Ramey writes: > >> Bash allows the close brace to be joined to the remaining > >> characters in the word without being followed by a shell metacharacter > >> as a reserved word would

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
On Fri, May 19, 2023, 18:35 alex xmb ratchev wrote: > > > On Fri, May 19, 2023, 18:04 Chet Ramey wrote: > >> On 5/19/23 6:11 AM, Robert Elz wrote: >> > Date:Thu, 18 May 2023 22:14:28 -0400 >> > From:"Dale R. Worley" >> > Message-ID:

Re: nofork command substitution

2023-05-19 Thread Chet Ramey
On 5/18/23 9:58 PM, Dale R. Worley wrote: Ángel writes: I suggest: There is an alternate form of command substitution: ${ COMMAND; } and clarify later the other variants in addition to a space: The character following the open brace must be a space, tab, newline, '(', or

Re: nofork command substitution

2023-05-19 Thread Chet Ramey
On 5/19/23 6:11 AM, Robert Elz wrote: Date:Thu, 18 May 2023 22:14:28 -0400 From:"Dale R. Worley" Message-ID: <874jo9kqyj@hobgoblin.ariadne.com> | Chet Ramey writes: | > Bash allows the close brace to be joined to the remaining | > characters in the

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
On Fri, May 19, 2023, 18:04 Chet Ramey wrote: > On 5/19/23 6:11 AM, Robert Elz wrote: > > Date:Thu, 18 May 2023 22:14:28 -0400 > > From:"Dale R. Worley" > > Message-ID: <874jo9kqyj@hobgoblin.ariadne.com> > > > >| Chet Ramey writes: > >| > Bash allows

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
On Fri, May 19, 2023, 14:25 alex xmb ratchev wrote: > > > On Fri, May 19, 2023, 13:54 Greg Wooledge wrote: > >> On Fri, May 19, 2023 at 01:36:44PM +0200, alex xmb ratchev wrote: >> > 'C ..' >> > ' ..' >> > '| ..' >> > >> > .. i dont get it >> >> Yeah, the wording isn't ideal. I'd start it out

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
'C ..' ' ..' '| ..' .. i dont get it On Mon, May 15, 2023, 19:35 Chet Ramey wrote: > The latest devel branch push has the initial implementation of `nofork' > command substitution. The excerpt from the info manual describing it is > appended. > > Please test it out, and find the places I

Re: nofork command substitution

2023-05-19 Thread Greg Wooledge
On Fri, May 19, 2023 at 01:36:44PM +0200, alex xmb ratchev wrote: > 'C ..' > ' ..' > '| ..' > > .. i dont get it Yeah, the wording isn't ideal. I'd start it out like this: ${ COMMAND; } ${| COMMAND; } Execute COMMAND in the current execution environment The first form (where the

Re: nofork command substitution

2023-05-19 Thread Greg Wooledge
On Fri, May 19, 2023 at 02:25:15PM +0200, alex xmb ratchev wrote: > On Fri, May 19, 2023, 13:54 Greg Wooledge wrote: > > > On Fri, May 19, 2023 at 01:36:44PM +0200, alex xmb ratchev wrote: > > > 'C ..' > > > ' ..' > > > '| ..' > > > > > > .. i dont get it > > > > Yeah, the wording isn't ideal.

Re: `wait -n` returns 127 when it shouldn't

2023-05-19 Thread Chet Ramey
On 5/19/23 6:24 AM, Robert Elz wrote: Date:Thu, 18 May 2023 14:07:32 -0400 From:Chet Ramey Message-ID: | This isn't a problem, and is a red herring. The code that manages that list | makes sure to keep as many jobs in the list as POSIX requires, subject

Re: nofork command substitution

2023-05-19 Thread Robert Elz
Date:Thu, 18 May 2023 22:14:28 -0400 From:"Dale R. Worley" Message-ID: <874jo9kqyj@hobgoblin.ariadne.com> | Chet Ramey writes: | > Bash allows the close brace to be joined to the remaining | > characters in the word without being followed by a shell

Re: `wait -n` returns 127 when it shouldn't

2023-05-19 Thread Robert Elz
Date:Thu, 18 May 2023 14:07:32 -0400 From:Chet Ramey Message-ID: | This isn't a problem, and is a red herring. The code that manages that list | makes sure to keep as many jobs in the list as POSIX requires, subject to | the maxchild resource limit. That is

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
On Fri, May 19, 2023, 13:54 Greg Wooledge wrote: > On Fri, May 19, 2023 at 01:36:44PM +0200, alex xmb ratchev wrote: > > 'C ..' > > ' ..' > > '| ..' > > > > .. i dont get it > > Yeah, the wording isn't ideal. I'd start it out like this: > yea better .. ${ COMMAND; } > ${| COMMAND; } >

Re: Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
On Fri, May 19, 2023, 22:08 Chet Ramey wrote: > I don't think this ever made it to the list. > > > -- Forwarded message -- > From: Chet Ramey > To: "Ángel" > Cc: chet.ra...@case.edu > Bcc: > Date: Wed, 17 May 2023 11:53:46 -0400 > Subject: Re: nofork command substitution > On

Re: nofork command substitution

2023-05-19 Thread Chet Ramey
On 5/19/23 7:36 AM, alex xmb ratchev wrote: 'C ..' ' ..' '| ..' .. i dont get it The `C' is the result of how info renders @var, used to indicate meta- syntactic variables (COMMAND is another). In other formats, it would be more apparent that it's not a literal `C' and that it's like the

Re: nofork command substitution

2023-05-19 Thread Chet Ramey
On 5/19/23 11:56 AM, alex xmb ratchev wrote: Command substitution is a word expansion; word expansions are performed on words; command substitution occurs as part of a word. That all seems self-evident. The only reason to mention it is the quirk required to have the close brace

Re: nofork command substitution

2023-05-19 Thread Robert Elz
Date:Fri, 19 May 2023 12:03:51 -0400 From:Chet Ramey Message-ID: <0a85095a-1665-d936-b4fa-118dd158e...@case.edu> | Maybe, and certainly possible, but a more likely use is just a simple | assignment to REPLY. In such cases, the value to be assigned needs to come

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
On Fri, May 19, 2023, 20:43 Robert Elz wrote: > Date:Fri, 19 May 2023 12:03:51 -0400 > From:Chet Ramey > Message-ID: <0a85095a-1665-d936-b4fa-118dd158e...@case.edu> > > > | Maybe, and certainly possible, but a more likely use is just a simple > | assignment to

Re: nofork command substitution

2023-05-19 Thread Greg Wooledge
On Fri, May 19, 2023 at 06:35:50PM +0200, alex xmb ratchev wrote: > so that i understand , > > var=${ awk ... } There's no reason to use this new thing if you're calling awk, because awk is an external program. You might as well just use var=$( awk ... ) instead. Either way, you're going to

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
On Fri, May 19, 2023, 21:11 Greg Wooledge wrote: > On Fri, May 19, 2023 at 06:35:50PM +0200, alex xmb ratchev wrote: > > so that i understand , > > > > var=${ awk ... } > > There's no reason to use this new thing if you're calling awk, because > awk is an external program. You might as well

Re: nofork command substitution

2023-05-19 Thread Grisha Levit
This will be a very neat feature to have. One thing I'm excited about is the ability to cleanly perform assignments during prompt expansion (e.g. to capture information during PS0 or PS4 expansion). Something I suspect people will complain about is that this change makes some polyglot zsh/bash

Re: nofork command substitution

2023-05-19 Thread alex xmb ratchev
is there a difference between } and ;} / ' }' On Fri, May 19, 2023, 20:43 Robert Elz wrote: > Date:Fri, 19 May 2023 12:03:51 -0400 > From:Chet Ramey > Message-ID: <0a85095a-1665-d936-b4fa-118dd158e...@case.edu> > > > | Maybe, and certainly possible, but a more

Fwd: Re: nofork command substitution

2023-05-19 Thread Chet Ramey
I don't think this ever made it to the list.--- Begin Message --- On 5/16/23 5:40 PM, Ángel wrote: On 2023-05-15 at 13:35 -0400, Chet Ramey wrote: There is an alternate form of command substitution: ${C COMMAND; } I find this description confusing, as it looks like a literal

Re: nofork command substitution

2023-05-19 Thread Chet Ramey
On 5/19/23 12:39 PM, alex xmb ratchev wrote: after ${| set -- 1 2 3 } , 1 2 3 are no more .. right ? ;} or space} to end .. ? The portion of the documentation I posted says: "the close brace must be in a position where a reserved word may appear (i.e., preceded by a command terminator