Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!bionet!uwmcsd1!marque!uunet!mcvax!enea!kth!osiris!uplog!thomas From: thomas@uplog.se (Thomas Hameenaho) Newsgroups: comp.unix.questions Subject: Re: Login shell? Message-ID: <331@uplog.se> Date: 10 Nov 88 08:33:02 GMT References: <314@uplog.se> <842@philmds.UUCP> <11@elgar.UUCP> <844@philmds.UUCP> <1829@ogccse.ogc.edu> Reply-To: thomas@uplog.UUCP (Thomas Hameenaho) Organization: TeleLOGIC Uppsala AB Lines: 17 In article <1829@ogccse.ogc.edu> schaefer@ogccse.UUCP (Barton E. Schaefer) writes: >I have no experience with SysV, so somebody else will have to tell >me if this does not work there. But on BSD, why not: > 1) Use "ps xl" (produces the PARENT pid as well as the pid) > 2) Grep for the pid > 3) Check the parent pid; if `1', then you have a login shell > This is not completely fool-proof either. If you have shell that isn't the login shell and you manage to kill the parent of this shell without killing the shell itself this shell winds up having a PPID of 1. -- Real life: Thomas Hameenaho Email: thomas@uplog.{se,uucp} Snail mail: TeleLOGIC Uppsala AB Phone: +46 18 189406 Box 1218 Fax: +46 18 132039 S - 751 42 Uppsala, Sweden