Re: process substitution in PROMPT_COMMAND

2011-08-07 Thread Chet Ramey
On 8/7/11 7:02 PM, Curtis Doty wrote: > On Sun, 7 Aug 2011, Chet Ramey wrote: > >> On 8/7/11 6:00 PM, Curtis Doty wrote: >>> local job jobcount=0 >>> while read job >>> do ((jobcount++)) >>> done < <(jobs) >> >> As you suspect, the problem is with this part of the function. It doesn't >>

Re: process substitution in PROMPT_COMMAND

2011-08-07 Thread Curtis Doty
On Sun, 7 Aug 2011, Chet Ramey wrote: On 8/7/11 6:00 PM, Curtis Doty wrote: local job jobcount=0 while read job do ((jobcount++)) done < <(jobs) As you suspect, the problem is with this part of the function. It doesn't really have anything to do with PROMPT_COMMAND, though. You must

Re: process substitution in PROMPT_COMMAND

2011-08-07 Thread Chet Ramey
On 8/7/11 6:00 PM, Curtis Doty wrote: > I've recently refactored my PROMPT_COMMAND function to avoid superfluous > fork()s. In the body of the function, what was once this line: > > local jobcount=$(jobs |wc -l) > > is now this: > > local job jobcount=0 > while read job > do ((jobcount++