Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spur.results.RunProcessError: return code: 127 #86

Closed
L-F-Escobar opened this issue Jun 5, 2019 · 3 comments
Closed

spur.results.RunProcessError: return code: 127 #86

L-F-Escobar opened this issue Jun 5, 2019 · 3 comments

Comments

@L-F-Escobar
Copy link

Return code 127 means a non-existing-command. I am trying to change the directory but am unable to because the 'cd' command seems to be non-existing. Any idea what is going on? All other commands seems to be working fine.

result = shell.run(["cd", "/mnt"])

@mwilliamson
Copy link
Owner

cd isn't an executable, which is why you're seeing an error. If you want to execute a command in a different directory, use the cwd argument.

@L-F-Escobar
Copy link
Author

L-F-Escobar commented Jun 5, 2019

How am I suppose to change directories?

I am trying to change my directory and print out its contents and save that locally

@mwilliamson
Copy link
Owner

If you want to list a directory, you can either pass the argument directly to ls:

shell.run(["ls", "/path/to/directory"])

or use the cwd argument:

shell.run(["ls"], cwd="/path/to/directory")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants