Re: nofork command substitution

2023-05-18 Thread Dale R. Worley
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 means. In particular "the word" isn't

Re: nofork command substitution

2023-05-18 Thread Dale R. Worley
Á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 '|', and the close brace must

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

2023-05-18 Thread Chet Ramey
On 5/18/23 7:51 AM, Robert Elz wrote: Apparently, in bash, if the code is running in a (shell) loop (like inside a while, or similar, loop) then each iteration around the loop, any jobs that have exited, but not been cleaned already, are removed from the queue (the jobs table in practice,

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

2023-05-18 Thread Chet Ramey
On 5/18/23 12:16 AM, Martin D Kealey wrote: If there is silent reaping going on (other than “wait -n” or “trap ... SIGCHLD”) shouldn't the exit status and pid of each silently reaped process be retained in a queue that “wait -n“ can extract from, in order to maintain the reasonable expected

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

2023-05-18 Thread Robert Elz
Date:Thu, 18 May 2023 07:35:35 -0400 From:Greg Wooledge Message-ID: | I'm fairly sure most (or all?) shells do this, not just bash. Interactive shells are "different" from those running a script in this regard. kre

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

2023-05-18 Thread Robert Elz
Date:Thu, 18 May 2023 14:16:17 +1000 From:Martin D Kealey Message-ID: | I know that some platforms (used to?) lack all of the “waitpid()”, This is irrelevant to the issue at hand (and in general, for shells, is irrelevant anyway, as shells usually always

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

2023-05-18 Thread Greg Wooledge
On Thu, May 18, 2023 at 02:16:17PM +1000, Martin D Kealey wrote: > If there is silent reaping going on (other than “wait -n” or “trap ... > SIGCHLD”) [...] Yes, bash silently reaps child processes. unicorn:~$ tty /dev/pts/2 unicorn:~$ sleep 5 & sleep 7 & [1] 942813 [2] 942814 unicorn:~$ tty