I start my screen connection with a spawn command within an expect script:
spawn screen /dev/…
But I don't know how I can kill the screen when the script is finished
expectgnu-screenunix
I start my screen connection with a spawn command within an expect script:
spawn screen /dev/…
But I don't know how I can kill the screen when the script is finished
Best Answer
When you run screen, use the
-S
option to give it a unique session name. Then, you can send it commands with the-X
option. Thequit
command will kill the screen, like so: