bash - Start a process in background, do a task, then kill the process in the background -


i have script looks 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 running tests, after phpunit command finishes i'd kill selenium-server running.

how can this?

when script excecuted new shell instance created. means jobs in new script not list jobs running in parent shell.

since selenium-server server background process created in new script can killed using

#the first job  kill %1 

or

#the last job same first 1 kill %- 

Comments