JPeterson

pipe.sh

Aug 3rd, 2012
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.47 KB | None | 0 0
  1. # test.sh
  2. #!/bin/bash
  3. ./test.exe|./readb.exe -t90|./readb.exe -t91
  4.  
  5. # pipe.sh
  6. #!/bin/bash
  7. for p in /proc/[0-9]*; do
  8.     if [[ "`readlink $p/fd/0`" != *pipe* ]] && [[ "`readlink $p/fd/1`" != *pipe* ]]; then continue; fi;
  9.     echo "pid: $p in:`readlink $p/fd/0` out:`readlink $p/fd/1`"
  10. done
  11. # pid: /proc/53988 in:/dev/pty0 out:pipe:[596] cmd:./test
  12. # pid: /proc/71072 in:pipe:[616] out:pipe:[220] cmd:./readb-t90
  13. # pid: /proc/69956 in:pipe:[224] out:/dev/pty0 cmd:./readb-t91
Advertisement
Add Comment
Please, Sign In to add comment