How can I run this shell script inside python?

Viewed 150

I want to run a bash script from a python program. The script has a command like this:

find . -type d -exec bash -c 'cd "$0" && gunzip -c *.gz | cut -f 3 >> ../mydoc.txt' {} \;

Normally I would run a subprocess call like:

subprocess.call('ls | wc -l', shell=True)

But that's not possible here because of the quoting signs. Any suggestions?

Thanks!

3 Answers
Related