Results 1 to 2 of 2
I run a game server for a game called Minecraft, and its all running through a Linux (CentOS 5.5) VPS. I have the server set up perfectly. I run hourly ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-27-2011 #1
- Join Date
- Mar 2011
Question About Screen Command
screen -x server -X stuff `printf "save-all\r"` sleep 2 cd server cd pandaland zip `date "+%Y-%m-%d-%H-%M-%S"`.zip -r ./* -x \*.zip
screen -x server -X stuff `printf "say testing\r"`
Nothing happens. I suspect that it is a problem with the spaces inside the command, but I can't get anything to work.
I then noticed that this code:
screen -x server -X stuff '<command>'
Anyone know what I should do?
- 04-04-2011 #2
- Join Date
- Nov 2008
- Tokyo, Japan
Are you absolutely sure you need to output a "\r" and not a "\n", or perhaps both "\n\r"? The "echo" command does "\n" for you, so you don't need printf for that. You could also try this:Code:
screen -x server -X stuff $(printf "say testing\r")
Also, when using "printf", it is better to use single-quotes instead of double-quotes because single-quotes do not expand special characters.Code:
screen -x server -X stuff $(printf 'say testing\r')