PID of a bash process not captured by $!
3
votes
3
answers
5761
views
While this part of the script works fine:
geany &
pid=$!
...
kill -KILL $pid
This, instead, does not.
lxterminal &
pid=$!
...
kill -KILL $pid
Looks like a bash process remains in the background, but it is not identified by
$pid
. How can I get the PID of the terminal window, such that the process can be killed afterwards?
Note: I also tried to kill it by its name, but the --title
option provokes some kind of conflict with PROMPT_COMMAND
.
Asked by nightcod3r
(982 rep)
Dec 29, 2016, 01:02 AM
Last activity: Jun 3, 2017, 01:32 PM
Last activity: Jun 3, 2017, 01:32 PM