How to capture the stdout of a running process which already has redirected it to /dev/null [duplicate]
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
.
精彩评论