Hi Pier,

On Mon, Jan 9, 2023 at 10:01 AM Pier Paolo Grassi <pierpaolog@gmail.com> wrote:
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

Could you explain what you mean by " I am looking for a way to get the tty controlling
a certain process". This seems backwards to me or am I misinterpreting what you said?
I haven't seen anything that shows ttys pointing to a process. It may exist, but I don't
know where you would find it if it does. I just know that processes attach tty devices
via file descriptors on Linux and Unix systems. The read command, in several shells,
supports this with the "-u N" option. Maybe I'm just looking at this from the wrong
perspective(wouldn't  be the first time).

Regards,

Jim