2011-05-25

Shell Scripting with GNU Screen

This launches a program in a new screen, method 1. Does not close window after program terminates...
screen -t "my-program" -p "-"
screen -p "my-program" -X stuff "/path/to/program
"
screen -X select "my-program"
This launches a program in a new screen, method 2. Closes window after program terminates...
screen -t "my-program" -p "-" "/path/to/program"
screen -X select "my-program"
This kills a process in another screen. This depends on screen-session which can be found at https://github.com/skoneka/screen-session ...
sudo screen-session kill "INT" "my-program"
This kills a screen window...
screen -p "my-program" -X kill
screen -wipe