Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: Why does xterm use $SHELL if available and not /etc/passwd Message-ID: <9012091709.AA15172@Larry.McRCIM.McGill.EDU> Date: 9 Dec 90 17:09:48 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 45 > Subject: Why does xterm use $SHELL if available and not /etc/passwd In a sentence, because that's the right thing to do. > xterm (X11R4 core dist) uses the SHELL environment variable to > determine which shell to run. It falls back on the password entry > shell if there is no SHELL environment variable set. (Whose passwd entry, by the way? In my experience, xterm has been very bad about confusing multiple users with the same UID. I believe it simply does getpwuid(getuid()); it could do much better than this.) > I'm curious as to the logic behind this. Probably because most other programs that run shells for the user to interact with do the same thing. > There's no mention of this behavior in the man page. True as far as I can tell, and should probably be fixed. > The reason I'm asking, is that we have a make on our system which > uses SHELL to determine which shell to use. Gack. > Since most Makefiles like to use /bin/sh, you need to have SHELL set > to /bin/sh. I'd prefer to write a small wrapper for make to fix it, rather than setting SHELL to /bin/sh and breaking everything else. Something like % cat ~/bin/make #! /bin/sh SHELL=/bin/sh; export SHELL case $# in 0) exec /bin/make ;; *) exec /bin/make "$@" ;; esac % der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu