Re: declare [-+]n behavior on existing (chained) namerefs

2016-04-29 Thread Grisha Levit
I should note also that the behavior when inside a function matches exactly what the manual says. It’s the global namerefs that have this unexpected behavior of following the chain to the end and and modifying only the last nameref in the chain. The only buggy behavior when inside of functions (ig

Re: Cannot grep jobs list when jobs called in a function

2016-04-29 Thread Reuti
> Am 29.04.2016 um 15:44 schrieb Greg Wooledge : > > On Fri, Apr 29, 2016 at 03:32:22PM +0200, Reuti wrote: >> I understand that the behavior of the builtin `jobs` changes, in case it >> discovers that it's run a subshell. But what is happening here: >> >> $ sleep 300 & >> [1] 31766 >> $ functi

Re: Cannot grep jobs list when jobs called in a function

2016-04-29 Thread Greg Wooledge
On Fri, Apr 29, 2016 at 03:32:22PM +0200, Reuti wrote: > I understand that the behavior of the builtin `jobs` changes, in case it > discovers that it's run a subshell. But what is happening here: > > $ sleep 300 & > [1] 31766 > $ function lister() { date; jobs; } > $ lister > Fri Apr 29 15:29:46

Re: Cannot grep jobs list when jobs called in a function

2016-04-29 Thread Reuti
> Am 29.04.2016 um 14:15 schrieb Greg Wooledge : > > On Thu, Apr 28, 2016 at 10:38:53AM -0600, Eric Blake wrote: >> Bash has code to special-case 'jobs |' when it can obviously tell that >> you are running the jobs builtin as the sole command of the left side of >> a pipe, to instead report about

Re: Cannot grep jobs list when jobs called in a function

2016-04-29 Thread Reuti
> Am 29.04.2016 um 15:32 schrieb Reuti : > > >> Am 29.04.2016 um 14:15 schrieb Greg Wooledge : >> >> On Thu, Apr 28, 2016 at 10:38:53AM -0600, Eric Blake wrote: >>> Bash has code to special-case 'jobs |' when it can obviously tell that >>> you are running the jobs builtin as the sole command of

Re: declare [-+]n behavior on existing (chained) namerefs

2016-04-29 Thread Piotr Grzybowski
On 29 Apr 2016, at 03:49, Grisha Levit wrote: > There is also an issue when doing something like `declare -n r=a' in a > function if the same has been done in a higher scope. Instead of creating a > new variable r in the function's scope, it modifies the local `a' to be a > self-referencing n

Re: Cannot grep jobs list when jobs called in a function

2016-04-29 Thread Greg Wooledge
On Thu, Apr 28, 2016 at 10:38:53AM -0600, Eric Blake wrote: > Bash has code to special-case 'jobs |' when it can obviously tell that > you are running the jobs builtin as the sole command of the left side of > a pipe, to instead report about the jobs of the parent shell, Oh, that's interesting. I

Re: Race condition in handling SIGHUP

2016-04-29 Thread Siteshwar Vashisht
- Original Message - > From: "Chet Ramey" > To: "Siteshwar Vashisht" , bug-bash@gnu.org > Cc: dkas...@redhat.com, "chet ramey" > Sent: Thursday, April 28, 2016 6:19:17 PM > Subject: Re: Race condition in handling SIGHUP > > On 4/27/16 6:04 AM, Siteshwar Vashisht wrote: > > > While thi