$ ssh root@123.123.123.123
123.123.123.123# pkill -f "stalled process name"; commands_to_restart; some_more_commands;
many many lines of output demonstrating success
123.123.123.123# exit;
ALL WORKS PERFECTLY
$ ssh root@123.123.123.123 "pkill -f "\""stalled process name"\"";"\
> "commands_to_restart; some_more_commands;";
no output, DOES NOTHING.
$ ssh root@123.123.123.123 "echo "\""pkill -f "\"\\\"\""stalled process name"\"\\\"\""; "\
> "commands_to_restart; some_more_commands;"\"";";
pkill -f "stalled process name"; commands_to_restart; some_more_commands;
so... TWO stages of quote escaping works as expected...
How do I get a single layer of quote escaping to work with ssh/bash?
Since quoting works perfectly in two layers I have a feeling it has less to do with the quoting and more to do with some aspect of ssh
s handling of the terminal. Yet, as far as I know the commands do nothing but simple and regular IO to standard output and no input.