Path: utzoo!attcan!uunet!pyrdc!pyrnj!rutgers!gatech!ulysses!ggs From: ggs@ulysses.homer.nj.att.com (Griff Smith) Newsgroups: comp.unix.wizards Subject: Re: make importing SHELL Summary: #! does have it's problems Message-ID: <10669@ulysses.homer.nj.att.com> Date: 30 Sep 88 15:06:17 GMT References: <452@alice.marlow.uucp> <67870@sun.uucp> <67925@sun.uucp> <4147@bsu-cs.UUCP> Organization: AT&T Bell Laboratories, Murray Hill Lines: 32 In article <4147@bsu-cs.UUCP>, dhesi@bsu-cs.UUCP (Rahul Dhesi) writes: > In article <13753@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: > >More generally, the problem is that the environment variable $SHELL has > >the meaning `user's preferred shell'... > > I think the problem is that $SHELL exists at all. It's a poor > substitute for the #! in 4.3BSD. > -- > Rahul Dhesi UUCP: !{iuvax,pur-ee}!bsu-cs!dhesi I won't contest the argument that $SHELL is overloaded. As a definition of "the interactive shell that I would prefer to use" it serves well enough, but it has problems when overextended to include program interpretation. $SHELL would be more useful if spit into at least two names; possibly $ISHELL (interactive) and $ESHELL (execution). However... #! is not a substitute. I have heard Dave Korn argue on several occasions that #! gets in the way. If $SHELL is set to point to ksh, a shell script can be executed by forking and interpreting the script in the child (don't ask about the kludges required to make this work reliably, I don't think I want to know). If #! is present, ksh must fork and exec unless it uses additional kludges to parse the rest of the #! line to determine whether the designated interpreter is ksh. I usually don't follow Dave's advice on this one; the "#! /bin/ksh" at the top is good documentation of my intentions and I am not as much of an optimizer as I used to be. -- 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