Exit a Screen after a script is finished Exit a Screen after a script is finished shell shell

Exit a Screen after a script is finished


This command will cause the current session of screen to quit:

screen -X quit

The syntax of the command in your second question looks OK to me. Can you be more specific about where you think there might be a problem?


Sometimes a stubborn script holding open a screen can be killed by sending it an abort key sequence:

screen -X -S "script0$scriptID" stuff "^C"