Re: Too many open files

2019-03-25 Thread sunnycemetery
On 2019-03-21 20:14, Chet Ramey wrote: Thanks for the report. The /dev/fd version of this code needs to reap process substitutions a little more often. It can't be *too* aggressive, since the fds can still be read even after the process generating the data has terminated, but it can do a little m

Re: wait -n shouldn't collect multiple processes

2019-03-25 Thread Ben Elliston
On Mon, Mar 25, 2019 at 04:53:02PM -0400, Chet Ramey wrote: > "wait waits for any job to terminate and returns its exit status" > > Doesn't that imply a single job? Not as clearly as saying "wait waits for a single job to terminate" :-) I guess I'm thinking that an exxplanation about the inter

Subshell exit trap is not invoked if shell exit trap also set

2019-03-25 Thread Konstantin Andreev
Consider the simple `ssxtrap' script: | #!/bin/bash | | echo ext pid=$BASHPID | # trap 'echo "ext exit trap in $BASHPID"' EXIT | | (echo int pid=$BASHPID | trap 'echo "int exit trap in $BASHPID"' EXIT | sleep 9) & | | wait | echo "subshell done" Let's run it: Terminal A

Re: wait -n shouldn't collect multiple processes

2019-03-25 Thread Chet Ramey
On 3/25/19 4:47 PM, Ben Elliston wrote: > On Mon, Mar 25, 2019 at 10:49:32AM -0400, Chet Ramey wrote: > >> This demonstrates that, despite what I said earlier, `wait -n' reaps >> one process at a time and returns its exit status. > > Thanks a lot. Can I suggest that a small tweak be made to the >

Re: wait -n shouldn't collect multiple processes

2019-03-25 Thread Ben Elliston
On Mon, Mar 25, 2019 at 10:49:32AM -0400, Chet Ramey wrote: > This demonstrates that, despite what I said earlier, `wait -n' reaps > one process at a time and returns its exit status. Thanks a lot. Can I suggest that a small tweak be made to the documentation to make this a bit clearer? Cheers,

Re: wait -n shouldn't collect multiple processes

2019-03-25 Thread Chet Ramey
On 3/25/19 4:05 PM, Robert Elz wrote: > Date:Mon, 25 Mar 2019 10:49:32 -0400 > From:Chet Ramey > Message-ID: <9c536452-4f4e-b309-7a99-e85235364...@case.edu> > > Great to see that revised description of how it works, that makes > much more sense. I also should have t

Re: wait -n shouldn't collect multiple processes

2019-03-25 Thread Robert Elz
Date:Mon, 25 Mar 2019 10:49:32 -0400 From:Chet Ramey Message-ID: <9c536452-4f4e-b309-7a99-e85235364...@case.edu> Great to see that revised description of how it works, that makes much more sense. I also should have tested it. | `wait -n' is only useful in scripts

Re: wait -n shouldn't collect multiple processes

2019-03-25 Thread Chet Ramey
On 3/23/19 1:33 AM, Ben Elliston wrote: > In bash 4.4.19, wait -n will collect the exit status of multiple > processes if there are any -- not just one: > > bje@bapbop:~$ sleep 10 & sleep 10 & sleep 10 & sleep 10 & > [1] 13296 > [2] 13297 > [3] 13298 > [4] 13299 > bje@bapbop:~$ wait -n > [1] Don

Re: [doc] missing doc about :+ vs + expansion

2019-03-25 Thread Christophe Lyon
On Mon, 25 Mar 2019 at 14:03, Andreas Kusalananda Kähäri wrote: > > On Mon, Mar 25, 2019 at 11:19:08AM +0100, Christophe Lyon wrote: > > Hi, > > > > I think I've noticed a bit of explanation missing in the documentation > > about parameter expansion. > > > > bash supports :+ and + expansion, but '

Re: [doc] missing doc about :+ vs + expansion

2019-03-25 Thread Chet Ramey
On 3/25/19 6:19 AM, Christophe Lyon wrote: > Hi, > > I think I've noticed a bit of explanation missing in the documentation > about parameter expansion. > > bash supports :+ and + expansion, but 'man bash' describes the former only. > This is also true for the similar expansions (:-, :=, :?) "Wh

Re: [doc] missing doc about :+ vs + expansion

2019-03-25 Thread Andreas Kusalananda Kähäri
On Mon, Mar 25, 2019 at 11:19:08AM +0100, Christophe Lyon wrote: > Hi, > > I think I've noticed a bit of explanation missing in the documentation > about parameter expansion. > > bash supports :+ and + expansion, but 'man bash' describes the former only. > This is also true for the similar expans

[doc] missing doc about :+ vs + expansion

2019-03-25 Thread Christophe Lyon
Hi, I think I've noticed a bit of explanation missing in the documentation about parameter expansion. bash supports :+ and + expansion, but 'man bash' describes the former only. This is also true for the similar expansions (:-, :=, :?) Some documentation is available at: http://pubs.opengroup.or