开发者

How to capture the stdout of a running process which already has redirected it to /dev/null [duplicate]

开发者 https://www.devze.com 2023-03-31 21:26 出处:网络
This question already has answers here: Closed 11 years ago. Possible Dupli开发者_如何转开发cate:
This question already has answers here: Closed 11 years ago.

Possible Dupli开发者_如何转开发cate:

How can a process intercept stdout and stderr of another process on Linux?

The process is already running and has all 0, 1, 2 redirected to /dev/null, how can I restore the stdout?

Thanks,


Analyzing ...

Possibility 1: you want to capture output that was redirected. You're out of luck.
Possibility 2: you want to capture output that will be redirected. Debug inject and call dup2.
Possibility 3: you are the process. Maybe try /dev/tty

.

0

精彩评论

暂无评论...
验证码 换一张
取 消