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 >> really have anything to do with PROMPT_COMMAND, though. You must be >> exporting the function so your PROMPT_COMMAND will work in interactive >> subshells, and the problem is there. > > Aha, indeed I have this too: > > export -f foo > > Removing it and the error goes away on successive subshells. :-) > > I already export PROMPT_COMMAND=foo. Maybe I don't need to try and > re-export the function every time also?
Well, if the PROMPT_COMMAND is exported to a subshell, and references a command named `foo', there should be a `foo' for it to execute. If you don't export the function, it probably won't find anything. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/