Clunch protection

Guy Harris guy at rlgvax.UUCP
Wed Oct 17 08:13:23 AEST 1984


> XXX
> > ... will let the kernel exec the script using the correct shell
> 
> On our system, the kernel can't exec scripts: it only execs files 
> with magic numbers.  I thought the choice of what command interpreter
> to exec to read the script was made by the shell, not by the kernel. 

Well, that depends on which of "our" systems you're talking about.  Our
VAXes and Power 6es can exec scripts, because they're running 4.2BSD-based
OSes; the Power 5s are running a V7/S3 based OS and can't.

Dennis Ritchie came up with the notion of permitting executable files to
be executable by an arbitrary interpreter other than the CPU hardware/
microcode; the way it's done is with a magic "number" of "#!".  The
characters following the "#!" are interpreted as the path of the program
to be executed and optional arguments to that program; the path of the
file to be "executed" is given as the last argument.

This has only been implemented on Berkeley systems, to my knowledge.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.unix mailing list