bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] silent job monitor when 'set +m'


From: Jeff Chua
Subject: Re: [PATCH] silent job monitor when 'set +m'
Date: Tue, 10 Nov 2009 23:39:01 +0800

On Tue, Nov 10, 2009 at 11:09 PM, Chet Ramey <address@hidden> wrote:

> Jeff Chua wrote:
> >
> >
> > On Tue, Nov 10, 2009 at 6:20 AM, Jan Schampera <address@hidden
> > <mailto:address@hidden>> wrote:
> >
> >     Chet Ramey schrieb:
> >
> >     > redirect stderr
> >     > kill pid
> >     > wait pid
> >     > restore stderr
> >     >
> >     > It seems to me that this sequence forces the necessary
> synchronicity.
> >
> >     Interesting. And sad that I never thought of that
> >
> >
> > Will you consider having like a new option "set -j" to switch displaying
> > job information on/off"?
>
> I am inclined not, since there's a relatively easy workaround.
>


How do you silent this one without a subshell. I just don't want to see the
"Terminated" output, but everything else in case there's error.

#!/bin/bash
sleep 60 &
P=$!
kill $P
sleep 1
exit


Currently, I'm doing it this way ...

#!/bin/bash
(
        sleep 60 &
        P=$!
        kill $P
        sleep 1
) 2>&1 | grep -v " Terminated"
exit


Thanks,
Jeff


reply via email to

[Prev in Thread] Current Thread [Next in Thread]