I got a python script from which I use ssh to open a connection to a different host. During this session I’m trying to run another python script, with several arguments (the script is on my machine and not on the server) but the arguments are messing it up. It links the arguments to the python interpreter rather than my script.
My code looks like this:
ssh remotehost python2 < /path/to/script —-arg1 hello —-arg2 goodbye
And the error I’m getting is unknown option per each character in the argument’s name, for example: Unknown option: —-
Unknown option:a
Unknown option:r
etc.. anyway I can pass arguments without getting this error? I tried using sys args but my arguments are sentences sometimes and it doesn’t parse it well..