Grabbing the output from the terminal
I need to run a proccess in the terminal to grab the output from it.
import subprocess
subprocess.check_output(["my_util", "some_file.txt", " | grep 'Some data1'
| awk '{print $2}'"])
#or
subprocess.check_output(["my_util", "full_path/some_file.txt", "| grep
'Some data1'", "| awk '{print $2}'"])
And nothing happens, while running it in the terminal manually gives me
the proper output.
No comments:
Post a Comment