Examples :
shell
|
a
/ \
b e
/ \ \
c d f
$ ./a.out ddduduudduuu abcdef
I'm c, my pid=2760, and my ppid=2759
I'm f, my pid=2762, and my ppid=2761
I'm d, my pid=2763, and my ppid=2759
I'm e, my pid=2761, and my ppid=2758
I'm a, my pid=2758, and my ppid=2460
I'm b, my pid=2759, and my ppid=2758
a <---- from stdin
hello, i'm a, my pid is 2758, counted 1 times <---- root answers
a <---- again
hello, i'm a, my pid is 2758, counted 2 times
b <---- from stdin
hello, i'm b, my pid is 2759, counted 1 times <---- sending via pipe to b
b
hello, i'm b, my pid is 2759, counted 2 times
c
hello, i'm c, my pid is 2760, counted 1 times
e
hello, i'm e, my pid is 2761, counted 1 times
e
hello, i'm e, my pid is 2761, counted 2 times
q <---- exit peacefully
$