I am executing some commands in a screen over SSH. This works perfectly:
ssh myuser@mydomain.com "screen -list; screen -r -d -X -S myscreen stuff $'echo here\n'"
But now rather than echo, I am trying to run the sed command, which contains double quotes.
sed -i -r "s/( host: )(\w+)/\1test/" file.yml
The double quotes are causing bash: syntax error near unexpected token `database_name:'
How do I properly escape the double quotes required for sed?