If a program PROG
is invoked with pipes,
progA | progB | PROG | progC ...
Is there a way for it to tell in what context it was invoked - i.e., from/to what other programs (A, B, C...) it is receiving or sending piped output?
I'm mostly interested in the immediate predecessor to PROG
(in the example above, progB
), but am also curious about the more general question.