First I create a named pipe at /tmp/.pipe by
which is then used in a shell script called A.sh like this
Code:
#!/bin/bash
cat /tmp/.pipe &
myprogram # some CLI program
If now I run this script in two different terminal sessions, and then do
Code:
ps -ef | grep "A.sh"
ps -ef | grep "cat /tmp/.pipe"
ps -ef | grep "myprogram"
I will get two different pids for script A.sh. Same to myprogram. My question is how to know which "cat /tmp/.pipe/" (or "myprogram") is initiated by which "A.sh" script? Thanks.