bash job control output redirection madness
Roger Oberholtzer
roger at opq.se
Wed Mar 25 00:34:57 PDT 2009
On Tue, 2009-03-24 at 08:18 -0700, Lonni J Friedman wrote:
> Hopefully someone has run across this before and has some ideas.
>
> I've got a (bash) shell script (foo.sh) that calls another shell
> script(bar.sh) and backgrounds it at the same time. Later on, foo.sh
> kills bar.sh. That much works fine. The problem is that when bar.sh
> gets killed (with kill), the shell spews output like this:
> ./foo.sh: line 57: 12434 Terminated ~/bar.sh
> ./foo.sh: line 57: 13707 Terminated ~/bar.sh
Perhaps the trap command could help? By default, the shell prints this
info. But with the trap command you can replace what happens with your
own function. I use it to catch ^C.
--
Roger Oberholtzer
OPQ Systems / Ramböll RST
Ramböll Sverige AB
Krukmakargatan 21
P.O. Box 17009
SE-104 62 Stockholm, Sweden
Office: Int +46 8-615 60 20
Mobile: Int +46 70-815 1696
More information about the Linux-users
mailing list