7

In Python, when I run a command with

os.system

what shell gets used?

1
  • 1
    os.system('echo $SHELL') calls default shell. And chsh utility sets default shell.
    – noobninja
    Jan 3 '18 at 18:08
5

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
  • And since Bourne Shell is sym-linked to use dash it uses dash :)
    – Videonauth
    Nov 15 '17 at 14:33

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.