我正试图做相反的事情
检测stdin是终端还是管道?
我正在运行一个正在更改其输出格式的应用程序,因为它检测到stdout上的管道,我希望它认为它是一个交互式终端,以便在重定向时获得相同的输出.
我当时认为将它包装在expect脚本中或使用proc_open()PHP中的它会这样做,但事实并非如此.
expect
proc_open()
有什么想法吗?
bash terminal stdin pipe
bash ×1
pipe ×1
stdin ×1
terminal ×1