Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: read with redirected stdin



hello Jim, your script reads the tty associated with the file descriptors, while I am looking for a way to get the tty controlling a certain process. I don't know much about this argument but it seems to me these are not necessarily the same.
cheers

Il giorno dom 8 gen 2023 alle 22:18 Jim <linux.tech.guy@xxxxxxxxx> ha scritto:

On Sat, Jan 7, 2023 at 10:44 PM Pier Paolo Grassi <pierpaolog@xxxxxxxxx> wrote:
Thanks, I'll check it out.

Pier Paolo Grassi

Not sure this is what you are looking for but in re-reading your original email you mention
checking for pipes. The script I attached  in the earlier email was checking fd 0, so I also
tried checking fd 1.  The results are as follows looking at my /proc. 

zstat +link /proc/<pid>/fd/0 2>/dev/null
25189 12199 17227 pts/40  man
25198 25189 17227 pipe    man
25199 25189 17227 pipe    less
zstat +link /proc/<pid>/fd/1 2>/dev/null
25189 12199 17227 pts/40  man
25198 25189 17227 pipe    man
25199 25189 17227 pts/40  less

Not sure if it will return what you are looking for in your case. The script is also
collecting other info to output the above results.

Regards,

Jim


Messages sorted by: Reverse Date, Date, Thread, Author