What shell does os.system use in Python?

In Python, when I run a command with

os.system

what shell gets used?

1

1 Answer

By default it will run in the Bourne shell (that would be /bin/sh).

os.system("/bin/bash \"echo 'Rincewind rules' \" ") to use bash and have it echo "Rincewind rules".

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like