bash job control output redirection madness
Lonni J Friedman
netllama at gmail.com
Wed Mar 25 07:31:37 PDT 2009
On Wed, Mar 25, 2009 at 12:34 AM, Roger Oberholtzer <roger at opq.se> wrote:
> 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.
Thanks. Actually, I found a solution using 'disown'. Basically I'm
not running bar.sh as follows:
~/bar.sh & disown > /dev/null 2>&1
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama at gmail.com
LlamaLand https://netllama.linux-sxs.org
More information about the Linux-users
mailing list