Path: utzoo!utgpu!attcan!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.unix.questions Subject: Re: Login shell? Message-ID: <1623@solo10.cs.vu.nl> Date: 4 Nov 88 15:13:51 GMT References: <3ed799bc.103e8@hi-csc.UUCP> <13851@mimsy.UUCP> <511@imec.UUCP> <25721@bu-cs.BU.EDU> <10791@ulysses.homer.nj.att.com> <1217@vsedev.VSE.COM> Reply-To: maart@cs.vu.nl (Maarten Litmaath) Organization: VU Informatica, Amsterdam Lines: 21 In article <1217@vsedev.VSE.COM> logan@vsedev.VSE.COM (James Logan III) writes: \... If you just want to find out what if the current \shell is indeed the shell spawned by init(1M) (via getty(1M), login(1)), \then just write a simple C program like this: \-------- \#include \ \main() \{ \ if (getppid() == getpgrp()) \ exit(0); \ exit(1); \} 1) Why #include ? 2) This scheme won't work for rsh/rlogin. -- George Bush: |Maarten Litmaath @ VU Amsterdam: Capt. Slip of the Tongue |maart@cs.vu.nl, mcvax!botter!maart