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