• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Issue command to app from bash script

Slapy

New Member
Joined
Jun 3, 2015
Messages
8 (0.00/day)
Hello,

I am noob and I was looking for this long time but didn't found answer how to do it. So what I want to do is I have minecraft server running in screen and I want to run srcipt from the same screen which would issue command each while to minecraft server.

I have tried
Code:
#!/bin/sh
while sleep 18
do
  screen -r minecraft -p 0 -X stuff "dc leaderboard all $(printf '\r')"
done
or with
Code:
echo "dc leaderboard all $(printf '\r')"
or with
Code:
dc leaderboard all

Neither of this was working first one ended up with error unable to find screen, second one wroked fine but didn't execute command and third one ended up with dc unknown command.

Any ideas how to do it? Thanks in advance for your responses.
 
Top