How to force os.system() to use bash instead of shell

前端 未结 5 722
轮回少年
轮回少年 2020-12-17 23:22

I\'ve tried what\'s told in How to force /bin/bash interpreter for oneliners

By doing

os.system(\'GREPDB=\"my command\"\')
os.system(\'/bin/bash -c          


        
5条回答
  •  暖寄归人
    2020-12-18 00:20

    I use this:

    subprocess.call(["bash","-c",cmd])
    

    //OK, ignore this because I have not notice subprocess not considered.

提交回复
热议问题