[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: job control
From: |
Chet Ramey |
Subject: |
Re: job control |
Date: |
Thu, 03 Jul 2003 08:25:30 -0400 |
> I'm not sure this is a bug, but I'm unable to do simple job control from =
> within a bash script. But I can from the command line, for instance:
>
> $ { sleep 10 & jobs -p; }
> [1] 30672
> 30672
>
> Works just fine but this script won't produce any output.
> -------------------------
> #!/bin/bash
>
> sleep 10 &
> jobs
> -------------------------
>
> I'm trying this with bash 2.05.1 on linux mandrake, I get the same =
> results on a solaris 2.5.1 machine with bash 2.03.0.
Job control is not enabled by default when the shell is not interactive.
Add `set -o monitor' to your script.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Chet Ramey, ITS, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/
- job control, Stuart Matheson, 2003/07/02
- Re: job control, Paul Jarc, 2003/07/02
- Message not available
- Re: job control,
Chet Ramey <=