I want to make a bash script that echo’s something into one of the screens that I have running (screen -r is how I get to it in SSH).
I was wondering how I would make the script execute itself in screen -r?
I basically just want the script to say something on a minecraft server through the console and would set up a cronjob to say it every x minutes.
Cheers,
You can use the
-Xoption ofscreento send commands to a running screen session.Also the
-poption is useful in this case, as you can use it to preselect a windowAs an example you can run a script in a running screen session on windows 0 via:
Note, that you have to append the return key-code to execute the script.