Which shell language should I use?

Guy Harris guy at auspex.auspex.com
Wed May 3 16:53:13 AEST 1989


>> 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. 



More information about the Comp.unix.questions mailing list