If I do something like:
Parent shell:> bash
bash-2.03$ ksh
$ tcsh
then if I find pid of bash and kill -9 it, the ksh and tcsh also
terminated (in a peculiar way. I urge you to try it out. They die in
"steps" i.e. if you do a ps as soon as you kill -9 the bash, you will
find the other two. then if you press return or something, one of them
dies, and then the other after another return. )
And sometimes, the parent shell from which it ( the first bash command)
was executed also gets nuked.
This behaviour appears to be quite peculiar to shells since other
programs seem to survive the killing of bash.
I am currently writing a shell (that "mimicks" the standards shells)
for a school project, and was wondering about this corner case. I would
greatly appreciate if someone would shed some light on why this
happens. Any pointers to relevant docs would also be greatly
appreciated.
thank you,
-karra