[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to suppress "Terminated..." message after kill
From: |
Bob Proulx |
Subject: |
Re: How to suppress "Terminated..." message after kill |
Date: |
Mon, 25 Sep 2006 20:52:11 -0600 |
User-agent: |
Mutt/1.5.9i |
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