0
screen -dmS SIEGE_01 
sleep 1
screen -S SIEGE_01 -X stuff "cd /home/ss12036/ImpulseNetwork/Servers/SIEGE_01/"`echo -ne '\015'`
sleep 1
screen -S SIEGE_01 -X stuff "sh Start.sh"`echo -ne '\015'`

There is my code. This is a sh script that will be running on machine restart. For whatever reason, from line 3 and beyond the commands don't appear to be sent to the screen. What am i doing wrong?

user3106527
  • 27
  • 1
  • 1
  • 3

1 Answers1

0

You need to select a window to stuff the command in using -p # eg

screen -S SIEGE_01 -p 0 -X stuff "cd /home/ss12036/ImpulseNetwork/Servers/SIEGE_01/"`echo -ne '\015'`

to send it to the first window (0).

Also if this is a bash script just use

screen -S SIEGE_01 -p 0 -X stuff "cd /home/ss12036/ImpulseNetwork/Servers/SIEGE_01/
"

to get the carriage return in the stuff command.

DerfK
  • 19,493
  • 2
  • 38
  • 54