Path: utzoo!attcan!uunet!lll-winken!lll-tis!mordor!joyce!ames!pasteur!ucbvax!ulysses!ggs From: ggs@ulysses.homer.nj.att.com (Griff Smith) Newsgroups: comp.unix.questions Subject: Re: Login shell? Summary: what about windowing terminals? Message-ID: <10791@ulysses.homer.nj.att.com> Date: 1 Nov 88 00:30:30 GMT References: <3ed799bc.103e8@hi-csc.UUCP> <13851@mimsy.UUCP> <511@imec.UUCP> <25721@bu-cs.BU.EDU> Organization: AT&T Bell Laboratories, Murray Hill Lines: 27 In article <25721@bu-cs.BU.EDU>, madd@bu-cs.BU.EDU (Jim Frost) writes: > In article <314@uplog.se> thomas@uplog.UUCP (Thomas Hameenaho) writes: | |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 '-'. | ... > That's not really a good indicator. Instead what I'd do is build the > process tree (you can use the output from ps or, better, sps if you > can't build it from the actual process table). Find the first entry in > the tree for the terminal you want. This will work on any unix > system, while the naming convention may not. | ... > jim frost > madd@bu-it.bu.edu Still not quite right. I usually use an AT&T 630 terminal on a 4.3BSD system. The login shell for the terminal is not the same as the shell for the current window, and each window has a separate pty connected to it. The kludge I use also involves reading the output of ps (ugh): I scan back through the process tree until I find a parent with a different uid. The child of that process is almost always the login shell. For my purposes, this also does the right thing for `su'. I'd rather have someone support the concept of a session id so we could avoid this sillyness. -- Griff Smith AT&T (Bell Laboratories), Murray Hill Phone: 1-201-582-7736 UUCP: {most AT&T sites}!ulysses!ggs Internet: ggs@ulysses.att.com