Use pipe to get output from subprocess.