Python Forum
unable to run unix command using spur - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: unable to run unix command using spur (/thread-12630.html)

Pages: 1 2


RE: unable to run unix command using spur - purnima1 - Sep-05-2018

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



RE: unable to run unix command using spur - purnima1 - Sep-07-2018

Hi team

Please help in resolving the issue