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
The solution below still initially invokes a shell, but it switches to bash for the command you are trying to execute:
os.system('/bin/bash -c "echo hello world"')