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++))
done < <(jobs)
This works fine on bash 4. However, when attempting to use this on an
older bash 3.00.15(1) host, an error occurs; but only on 2nd or additional
subshells--not the first login shell!?! I.e. everything works fine, until
I run bash from bash.
bash: foo: line 39: syntax error near unexpected token `('
bash: foo: line 39: ` done <<(jobs);'
bash: error importing function definition for `foo'
Am I missing a finer point of redirection from a substituted process? Or
is something different in bash 3 that I need to work around here?
../C