1

I'm trying to execute a complex shell command from inside of python. The naive attempt:

subprocess.call(["find", ".", "-exec touch {} \;"], cwd=".")

is failing. How do I go about doing this?

1 Answer 1

7
subprocess.call(["find", ".", "-exec", "touch", "{}", ";"])

cwd="." Is not needed as it is the default.

Sign up to request clarification or add additional context in comments.

1 Comment

Defaulting to "." is an extension (I think it is a GNU extension). The standard requires a path in the command line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.