[PLUG] trying to see the redirects for an active command question

logical american website.reader3 at gmail.com
Mon Aug 26 22:43:51 UTC 2019


Hi:

Does anyone know how to view the redirected input and output for a 
running command from the /proc section ?

Yes I am aware of /proc/pid/fd/0,1,2 being input/output/error but 
reading the man page for /proc showed only the cmdline and args[1], but 
I could not see how to obtain the redirect information sent to the std 
input and output for the CLI command, at the beginning of command execution.

example:

% my_command < input.file > output.file

/proc/pid/fd/0 and /proc/pid/fd/1 show nothing about the redirect, 
however I want to recover that information for the running command.

Thanks for figuring this out.

- Randall

[1] http://man7.org/linux/man-pages/man5/proc.5.html





More information about the PLUG mailing list