|
|
|
@ -18,14 +18,20 @@ logfile.write("$ " + command + "\n")
|
|
|
|
|
|
|
|
|
|
prc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
|
|
|
|
|
|
|
while prc.poll():
|
|
|
|
|
stdout, stderr = prc.communicate()
|
|
|
|
|
|
|
|
|
|
logfile.write(stdout + "\n" + stderr + "\n")
|
|
|
|
|
sys.stdout.write(stdout)
|
|
|
|
|
sys.stderr.write(stderr)
|
|
|
|
|
|
|
|
|
|
stdout, stderr = prc.communicate()
|
|
|
|
|
while prc.poll() is None:
|
|
|
|
|
stdout = prc.stdout.read()
|
|
|
|
|
stderr = prc.stderr.read()
|
|
|
|
|
|
|
|
|
|
if stdout.strip() != "":
|
|
|
|
|
sys.stdout.write(stdout)
|
|
|
|
|
logfile.write(stdout + "\n")
|
|
|
|
|
|
|
|
|
|
if stderr.strip() != "":
|
|
|
|
|
sys.stderr.write(stderr)
|
|
|
|
|
logfile.write(stderr + "\n")
|
|
|
|
|
|
|
|
|
|
stdout = prc.stdout.read()
|
|
|
|
|
stderr = prc.stderr.read()
|
|
|
|
|
|
|
|
|
|
logfile.write(stdout + "\n" + stderr + "\n")
|
|
|
|
|
sys.stdout.write(stdout)
|
|
|
|
|