I am using:
grepOut = subprocess.check_output(\"grep \" + search + \" tmp\", shell=True)
To run a terminal command, I know that I can use a
To get both output and return code (without try/except) simply use subprocess.getstatusoutput (Python 3 required)