Right now I'm running a process within GNU screen. Screen is started with the command screen -dmS screenname
and the attached with screen -r screenname
. A process is started in the screen session, and is killed after some time.
How would I have the screen terminate when the process inside has ended?
Note: I wouldn't prefer a loop, so I'm looking for an alternative. Sometimes I start the process with an & exit
following it, but that never executes if I use kill -9 pid
on the process.