Python Forum
unable to run unix command using spur
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unable to run unix command using spur
#11
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
Reply
#12
Hi team

Please help in resolving the issue
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyspark sql unable to recognize SQL query command cpatte7372 6 16,580 Jul-31-2018, 04:17 PM
Last Post: micseydel
  How to run unix command in python soubalaji 1 3,197 Jan-11-2018, 07:16 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020