Chet Ramey wrote:
> Com MN PG P E B Consultant 3 wrote:
> > monitest.sh: line 9:  3486 Terminated    tail -f foo >bar
> > (1) Monitor was not set
>...
> Not really.  If a pipeline in a shell script is killed by a
> signal other than SIGINT or SIGPIPE, the shell reports it.  People
> generally want to know when their processes are killed.  It's
> independent of job control.

After reading through this again I realized this was a different case
than I originally thought.  I did not quite understand the situation
yet.  I looked at my own collection of scripts on HP-UX and found that
I do something very similar using the native POSIX shell there.
Running that under bash prints out the error message and it is
undesireable in that case too.

> If you want to suppress the message, redirect stderr to /dev/null.

After thinking about this more I will throw my vote in with the
original poster.  I think it is not intuitive for bash to display this
message when monitor is off.  I tested ksh, zsh and ash and none of
them report in that case.  Redirecting stderr for the shell to
/dev/null silences other errors and is inconvenient to need to do.
(i.e.. Save off stderr, redirect, kill, restore stderr.)

I think it is good to print the Terminated message when interactive
and monitor is on.  But I think the shell should not print Terminated
when not interactive and monitor is off.

Bob


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to