I am designing a script to launch a process inside a named screen session.
as_user "screen -p 0 -S **$command** -X eval 'stuff \"wine LFS.exe /cfg=**$command**.cfg\"\015'"
So bash myscript.sh start test
will create a screen named test and run the test.cfg
with the software.
Now I want my script to access the specific screen session and do a CTRL+C to stop the running process so i can kill the screen session.
Something like this:
as_user "screen -p 0 -S **$command** **... kill the process with ctrl-c...**"
as_user "screen -p 0 -S **$command** -X eval 'stuff \"exit\"\015'"
at
to work, but this worked for me for the active window only, which might be useful for someone:screen -S session_name -X stuff $'\003'
– Coneflower