mwilliamson / spur.py

Run commands and manipulate files locally or over SSH using the same interface
BSD 2-Clause "Simplified" License
267 stars 37 forks source link

Cannot use shell logic. #62

Closed JontomXire closed 7 years ago

JontomXire commented 7 years ago

If I try to execute the following in an SSH shell:

result = shell.run(['sh', '-c', 'test', '1', '-eq', '1', '&&', 'echo', 'Hello world'], allow_error=True)

I get nothing back. Because 1==1 I should get the output from 'echo "Hello world"' back.

JontomXire commented 7 years ago

I'm being dense. Sorry. I didn't notice in your example that the command needs to be a single string when using "sh -c".