I'm trying to bind Alt-s to an SSH command that is quite complex and requires nested double quotes.bind '\es:ssh -t me@myserver  \echo \\hi\\; echo \\bye\\\'But when I execute the keybinding half the string is truncated:ssh -t me@myserver  echo \hi\;How do I get the entire string to be inserted? I don't know if this is a problem with the space after the semi colon, or with all the double-escaping of double-quotes. Note: I don't want to use bind -x style because that one a) doesn't print the actual command b) executes it without any ability to manually modify the line before executing it by pressing enter.
bind to string with escaped double-quotes
bash;readline
Escaping for shell strings is tricky.  Try:bind '\es:ssh -t localhost  \echo \\\hi\\\; echo \\\bye\\\\'After the above command is executed, then Esc-s should result in the following text on the command line:ssh -t localhost  echo \hi\; echo \bye\This will work correctly.  When executed, it  produces the output:hibyeConnection to localhost closed.The issue was that \\ is interpreted as a single backslash followed by a shell-active double-quote.  You need to escape the double-quote so that it is inactive.  Thus \\\.