2 ms·
Here's a wrapper script I wrote that has the same syntax as the ssh command but automatically shell-quotes arguments, ensuring they're passed through 1:1 to the
by comex 3y ago
Here's a wrapper script I wrote that has the same syntax as the ssh command but automatically shell-quotes arguments, ensuring they're passed through 1:1 to the remote command:
https://gist.github.com/comex/2faf21ebee93b0bd64841c30c7d28026 https://gist.github.com/comex/2faf21ebee93b0bd64841c30c7d280...
The quoting is done with Python's shlex.quote(), whose output should parse properly in any POSIX-compatible shell. (Before editing this comment I had linked a similar script from Stack Overflow, but it uses bash's printf %q to quote, which produces output that uses ANSI-C quoting, which isn't supported by dash.)