0

I have been trying different ways to get this to work.

ssh netpc screen -S minecraft -X stuff "say Performing save/backup operations there may be lag...not really this is a test$(printf '\r')"

It fails to recognize the $(printf ‘\r’) due to some escape character that eludes me. Please help.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

0

I will answer my question.

#!/bin/bash

say_this()
{
    screen -S $REEN -p 0 -X stuff "$1^M"
}

say_this “say Saving world”
say_this “save-off”
say_this “save-all”
...

This is with ssh! #!/bin/bash

say_this()
{
    # Dont forget to set NAME or whatever
    ssh -p 8989 192.168.1.101 screen -S $NAME -p 0 -X stuff \"$1^M\"
}

say_this "say test"
say_this "say !@#$%^&*()<>?This string will work!"