Hey! That's quite cool!
But you need to qualify it...
i.e...
Code:
/root #
/root # echo $0
-ksh
/root # echo $$
13898
/root # bash
/root # echo $$
13921
/root # ps -o "%P"
PPID
13896
13898
13921
/root # ps -ef | grep 13[89][95]
root 13896 1 0 18:52 ? 00:00:01 /usr/bin/Terminal
root 13897 13896 0 18:52 ? 00:00:00 gnome-pty-helper
root 13898 13896 0 18:52 pts/0 00:00:00 -ksh
root 13951 13898 0 18:54 pts/0 00:00:00 bash
root 13973 13951 0 18:55 pts/0 00:00:00 ps -ef
root 13974 13951 1 18:55 pts/0 00:00:00 grep 13[89][95]