I have a script that looks like this:
pushd .
nohup java -jar test/selenium-server.jar > /dev/null 2>&1 &
cd web/code/protected/tests/
phpunit functional/
popd
The selenium servers needs to be running for the tests, however after the phpunit command finishes I'd like to kill the selenium-server that was running.
How can I do this?
%1
stands for "first background job", and your script only sends one process to background tldp.org/LDP/abs/html/x9644.html%1
) you can save$!
after running nohup and kill the process by PID.kill %-
which will kill the last job