|
From: | Ion Savin |
Subject: | Re: [Help-bash] `eval' subprocess not terminated |
Date: | Thu, 06 Feb 2014 10:33:45 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
Hi Matthew,
I'm launching a script which is using `eval' to start a long running process (just as an example I'll use xeyes): $ cat test.sh #!/bin/bash eval xeyes $ ./test.sh From another terminal I kill the shell process: $ kill -9 `ps h --format pid -C "test.sh"` The shell process terminates but the child process is not killed. Is there any way to force bash (I'm using ver. 4.2.45) to terminate the `eval' subprocesses it has created?Why do you need eval at all? Are you sure you don't mean to be using exec?
In the real world scenario test.sh is actually one of many third party scripts each of which could contain `eval'. This is why I would prefer to find a solution which works without any changes to the script itself if possible.
<greybot> 'eval' is a common misspelling of 'evil'. If eval is the answer, surely you are asking the wrong question. See http://mywiki.wooledge.org/BashFAQ/048
Nice. Thank you for the link! Cheers, Ion
[Prev in Thread] | Current Thread | [Next in Thread] |