On Tue, Nov 10, 2009 at 11:09 PM, Chet Ramey <chet.ra...@case.edu> wrote:

> Jeff Chua wrote:
> >
> >
> > On Tue, Nov 10, 2009 at 6:20 AM, Jan Schampera <jan.schamp...@web.de
> > <mailto:jan.schamp...@web.de>> 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