0
我在尋找這樣的一個反面: Trick an application into thinking its stdin is interactive, not a pipe招數應用到想這是一個管道,而不是互動
我想獲得stdout中的命令的輸出,但要認爲這是寫成管道。
通常的解決方案是| cat
但是我有額外的要求,這是跨平臺(即sh
,不bash
),並且如果命令失敗返回一個有效的退出代碼。通常我會使用pipefail,但這在任何地方都不可用。
我試過stty
的各種咒語,但沒有成功。