i want to send commands into a screen with .sh script.
Start a CSGO server with:
screen -S cs ./srcds_run -game csgo -usercon
How can i send a command to the csgo server like:
sv_cheats 1
Asked
Active
Viewed 248 times
0

Vadim Kotov
- 8,084
- 8
- 48
- 62

BuschCo
- 1
1 Answers
0
From the screen manpage:
-X Send the specified command to a running screen session.
At https://unix.stackexchange.com/questions/13953/sending-text-input-to-a-detached-screen you find a similar question.
So for your specific problem the solution would be:
screen -S cs -X stuff "sv_scheats 1"

Community
- 1
- 1

dingensundso
- 176
- 4
-
so the line is now inside the server console but i need someone to press enter? – BuschCo Aug 08 '15 at 08:56
-
just add \n at the end – dingensundso Aug 09 '15 at 01:30
-
screen -S cs -p 0 -X stuff "sv_cheats 0"^M that finaly worked – BuschCo Aug 30 '15 at 14:36