Python Forum

Full Version: unable to run unix command using spur
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hi Experts,

I tried 3 changes at line no. 7 but none of them worked

shell.run(["sh", "-c", "echo $PATH"])
shell.run(["echo $PATH"])
shell.run(["echo Hello"])
Error:
Traceback (most recent call last): File "unix_server_test.py", line 26, in <module> result = shell.run(["sh", "-c", "echo $PATH"]) File "C:\Users\pubhatia\AppData\Local\Programs\Python\Python36\lib\site-packages\spur\ssh.py", line 166, in run return self.spawn(*args, **kwargs).wait_for_result() File "C:\Users\pubhatia\AppData\Local\Programs\Python\Python36\lib\site-packages\spur\ssh.py", line 206, in spawn raise NoSuchCommandError(command[0]) spur.errors.NoSuchCommandError: Command not found: sh. Check that sh is installed and on $PATH C:\Users\pubhatia\Documents\learning\python>py unix_server_test.py Traceback (most recent call last): File "unix_server_test.py", line 26, in <module> result = shell.run(["echo $PATH"]) File "C:\Users\pubhatia\AppData\Local\Programs\Python\Python36\lib\site-packages\spur\ssh.py", line 166, in run return self.spawn(*args, **kwargs).wait_for_result() File "C:\Users\pubhatia\AppData\Local\Programs\Python\Python36\lib\site-packages\spur\ssh.py", line 206, in spawn raise NoSuchCommandError(command[0]) spur.errors.NoSuchCommandError: Command not found: echo $PATH. Check that echo $PATH is installed and on $PATH C:\Users\pubhatia\Documents\learning\python>py unix_server_test.py Traceback (most recent call last): File "unix_server_test.py", line 26, in <module> result = shell.run(["echo Hello"]) File "C:\Users\pubhatia\AppData\Local\Programs\Python\Python36\lib\site-packages\spur\ssh.py", line 166, in run return self.spawn(*args, **kwargs).wait_for_result() File "C:\Users\pubhatia\AppData\Local\Programs\Python\Python36\lib\site-packages\spur\ssh.py", line 206, in spawn raise NoSuchCommandError(command[0]) spur.errors.NoSuchCommandError: Command not found: echo Hello. Check that echo Hello is installed and on $PATH
Hi team

Please help in resolving the issue
Pages: 1 2