RE: How to suppress "Terminated..." message after kill

2006-09-22 Thread Com MN PG P E B Consultant 3
> Com MN PG P E B Consultant 3 wrote:
> >    (PID) Terminated  tail -f file >outfile
> > Is there a way to suppress this message? (bash 2.05b)
> 
> Use:
>   set +m
> Why is monitor set for your script?  That would only be typical for
> interactive shells but not typical for scripts. 

Good point, but I'm pretty sure that this is not related to monitor.
Look at the following script (which I named monitest.sh):

#!/usr/local/bin/bash --norc
echo $-
set +m
touch foo
tail -f foo >bar &
pid=$!
sleep 1
kill $pid
sleep 1
echo finish

When I execute it, I get the following output:

hB
monitest.sh: line 9:  3486 Terminatedtail -f foo >bar
finish


>From this we can see:

(1) Monitor was not set
(2) Even if it had been set, +m would have turned it off
(3) Still, the Terminated message is printed.

Strange, isn't it?

Someone out there using bash 2.05, who could try the above
script and see whether the same result appears?

Ronald
-- 
Ronald Fischer (phone +49-89-63676431)
mailto:[EMAIL PROTECTED]


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


Re: How to suppress "Terminated..." message after kill

2006-09-22 Thread Chet Ramey
Com MN PG P E B Consultant 3 wrote:

> monitest.sh: line 9:  3486 Terminatedtail -f foo >bar
> finish
> 
> 
>>From this we can see:
> 
> (1) Monitor was not set
> (2) Even if it had been set, +m would have turned it off
> (3) Still, the Terminated message is printed.
> 
> Strange, isn't it?

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.

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

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
   Live Strong.  No day but today.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


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