Hi all,
I have a python script on one server (serv_one) and I am trying to execute it remotely from another (serv_two). The python script takes an argument with spaces. If I execute it locally:
Code:
foo@serv_one> script.py --o "arg one"
"arg one" is preserved, of course. ( argv = [ '--o', 'arg one' ] )
However, when I execute it remotely:
Code:
foo@serv_two> ssh ... foo@serv_one script.py --o "arg one"
the double quotes around "arg one" are dismissed ( argv = [ '--o', 'arg', 'one' ].
I've tried many combinations of single quotes/double quotes/backslashes, etc, to no avail.
One hack solution I came up with, since I have the flexibility, was to replace all spaces in the quoted argument with a character that would be invalid in the argument (before the ssh call), and replace those with spaces in script.py. I would probably like to avoid this solution if at all possible.
I've actually had some time looking for a solution to this on google and surprisingly not much help -- considering this seems like it would be fairly common.
Anyway, if anyone knows how to solve this that would be great.
Both machines are running 64-bit RH5.3, python 2.5.
Thanks!