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?

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .