Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!gatech!ncar!boulder!sunybcs!bingvaxu!leah!uwmcsd1!marque!uunet!mcvax!enea!kth!sics!uplog!thomas From: thomas@uplog.se (Thomas Hameenaho) Newsgroups: comp.unix.questions Subject: Re: Login shell? Message-ID: <314@uplog.se> Date: 17 Oct 88 12:59:49 GMT References: <3ed799bc.103e8@hi-csc.UUCP> <13851@mimsy.UUCP> <511@imec.UUCP> <1529@solo9.cs.vu.nl> Reply-To: thomas@uplog.UUCP (Thomas Hameenaho) Organization: TeleLOGIC Uppsala AB Lines: 14 One way of deciding wether or not the current shell is the login shell is the fact that the name of the login shell is prependended with a '-'. If for instance I run tcsh as my login shell it will be exec:ed with -tcsh as argv[0]. Just take the output from ps -x (or -f if on system V) grep for pid $$ and check if the command name begins with a '-'. If that is the case the shell is the login shell. -- 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