views:

125

answers:

1

When a script that I started in a screen is finished can I tell it to close the current Screen it's in? If so how? I know I can do "ctrl + a" then k, then y. To kill it but Im not there to issue those buttons. And I tried adding "exit" to the end of the script which doesn't seem to close it ether.

I also have a script that will auto start another script in a screen, this seems to work, but Im not 100% sure that I got all the syntax right?

screen -dm -S "script0$scriptID"; sleep 1; screen -S "fscript0$scriptID" -X screen ./script.sh "$input1" "$input2"

Thanks any help.

+3  A: 

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?

Dennis Williamson
Thanks, this seems to do the trick.I don't really know where the problem is, it just seemed a bit inefficient the way I did it.
Mint