在Ruby的popen/spawn中,如何合併STDOUT和STDERR作爲單個數據流,而不使用>2&1
?在Popen中合併標準輸出和stderr
在Python,這將是:
>>> import subprocess
>>> subprocess.check_output('my_prog args', stderr=subprocess.STDOUT, shell=True)
注意stderr
說法。
I use Open3 - 因爲我不想要只是標準輸出 - 但它已經將它們分成兩個流。