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

2016-05-25 Thread Chet Ramey
On 4/29/16 9:32 AM, 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 CEST 2016 > [1]+ Run

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: 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: Cannot grep jobs list when jobs called in a function

2016-04-28 Thread Bishop Bettini
On Thu, Apr 28, 2016 at 12:38 PM, Eric Blake wrote: > On 04/28/2016 07:26 AM, Bishop Bettini wrote: > > Hi! > > > > As described in this Stack Overflow question > > , I'm experiencing what > > appears to me as unusual behavior with the jobs command, w

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

2016-04-28 Thread Eric Blake
On 04/28/2016 07:26 AM, Bishop Bettini wrote: > Hi! > > As described in this Stack Overflow question > , I'm experiencing what > appears to me as unusual behavior with the jobs command, when jobs is > within a function. In short: > > $ jobs > [1]+ Ru

Cannot grep jobs list when jobs called in a function

2016-04-28 Thread Bishop Bettini
Hi! As described in this Stack Overflow question , I'm experiencing what appears to me as unusual behavior with the jobs command, when jobs is within a function. In short: $ jobs [1]+ Running vim [2]+ Stopped matlab $ type realjob