Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: Which shell language should I use? Message-ID: <1540@auspex.auspex.com> Date: 3 May 89 06:53:13 GMT References: <113700004@uxa.cso.uiuc.edu> <1917@ssc.UUCP> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 31 >> 1. How much of the Berkeley-originated script files were written >> in Bourn-shell language? >My guess -- most. I checked the ones in the directories under "/usr/src", looking for ".sh" and ".csh" source files, and the former outnumbered the latter 17 to 1 in the 4.3-tahoe source. This at least indicates that most are written in Bourne shell. >>[stuff about #!] >Yes. Not all shells understand these (XENIX being the biggest >example). 4.x BSD being another example - it's not understood by the shell, it's understood by the 4.xBSD kernel, which implements the "exec" calls. In 4.xBSD and in most systems that have picked up "#!", putting in a "#!" line makes a script for some program executable in the same way that a program is - plain old boring "exec" calls can run it. Some systems may have implemented it in the shell. >> 3. Where in the UNIX manual can I find some kind of rule on which >> shell-script parser is applied for a certain shell-script file? >Your SHELL environment variable determines which shell is invoked to >interpret a script. Well, sort of, in the sense that the shell at which you type the name of the shell script file determines which shell is used to interpret the script, and the SHELL environment variable is set to the name of that shell. Merely changing the SHELL environment variable won't necessarily change the shell used to interpret the script, however.