Ubuntu – What shell does os.system use in Python

python

In Python, when I run a command with

os.system

what shell gets used?

Best 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".