[gnu.bash.bug] background jobs in 1.04

roy@sts.sts.COM (11/22/89)

I'm running Bash 1.04, compiled with gcc v1.30 on a Sun3/60 with SunOS
4.0.  I've just noticed that, if you put some jobs in the background
and they've completed, it takes an execution of a non-builtin command
(i.e. not the 'jobs' command) to make the shell realize that the jobs
are actually complete.  I don't see any reason why a builtin command
shouldn't do this.  The C shell will even notify you of job completion
after you've typed a carriage return.

Also, the C shell has a variable called 'notify', which when set, will
asynchronously notify you that your background job is finished.  How
about if Bash had this too?


Roy Bixler
roy@sts.COM -or- ames!claris!sts!roy

trost@reed.bitnet (Bill Trost) (11/23/89)

Roy Bixler <roy@sts.com> writes:
"... I don't see any reason why a builtin command
shouldn't do this.  The C shell will even notify you of job completion
after you've typed a carriage return.

"Also, the C shell has a variable called 'notify', which when set, will
asynchronously notify you that your background job is finished.  How
about if Bash had this too?"

Seconded.  Waiting for jobs to complete has been rather bizarre in
bash, especially since the most natural way to see if a job is done is
by typing "jobs", and the command doesn't give correct information.
It would seem that the best place to see if jobs have been completed
would be right before the potential execution of the PROMPT_COMMAND.
--
--

bfox@AUREL.CNS.CALTECH.EDU (Brian Fox) (11/24/89)

   Date: 23 Nov 89 00:52:39 GMT
   From: ctrsol!emory!ogccse!reed!trost@gem.mps.ohio-state.edu  (Bill Trost)
   References: <278200004@sts>
   Sender: bug-bash-request@prep.ai.mit.edu

   Roy Bixler <roy@sts.com> writes:
   "... I don't see any reason why a builtin command
   shouldn't do this.  The C shell will even notify you of job completion
   after you've typed a carriage return.

   "Also, the C shell has a variable called 'notify', which when set, will
   asynchronously notify you that your background job is finished.  How
   about if Bash had this too?"

   Seconded.  Waiting for jobs to complete has been rather bizarre in
   bash, especially since the most natural way to see if a job is done is
   by typing "jobs", and the command doesn't give correct information.
   It would seem that the best place to see if jobs have been completed
   would be right before the potential execution of the PROMPT_COMMAND.
   --
   --

notify=

Brian

roy@sts.sts.COM (11/28/89)

I did have the 'notify' variable of Bash set exactly as specified
(notify=).  It still only notify'ed me of job comletion on execution
of an external command.

Roy
roy@sts.COM

trost@reed.bitnet (Bill Trost) (11/28/89)

Oops, guess I should have peeked around the source a bit (or just try
it).  "notify" does work, sort of.

However, it still doesn't match csh behavior (which I consider to be
correct _in this case_ :-) ).  When notify is set under csh, job
status change will be scribbled at you even at the prompt.  Plus, the
same misbehavior with builtins sticks around.

Well anyhow, enough noise about this one.
--
--

bfox@AUREL.CNS.CALTECH.EDU (Brian Fox) (11/28/89)

   I did have the 'notify' variable of Bash set exactly as specified
   (notify=).  It still only notify'ed me of job comletion on execution
   of an external command.

   Roy
   roy@sts.COM

Are you saying that you have different results than:

    bfox@playdoh$ sleep 2 &
    [1] 3854
    bfox@playdoh$ [1]+  Done                sleep 20

Brian