Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!munnari!kre From: kre@munnari.OZ (Robert Elz) Newsgroups: net.unix-wizards Subject: Re: Problems with System V Release 2.1 on 68010 Message-ID: <1091@munnari.OZ> Date: Wed, 16-Apr-86 11:34:11 EST Article-I.D.: munnari.1091 Posted: Wed Apr 16 11:34:11 1986 Date-Received: Fri, 18-Apr-86 08:47:58 EST References: <412@hropus.UUCP> Organization: Comp Sci, Melbourne Uni, Australia Lines: 35 In article <412@hropus.UUCP>, ka@hropus.UUCP (Kenneth Almquist) writes: > An alternative approach is to have the shell handle "#!". If you do this you lose what is one of the main advantages of #!, that is that exec() works on them from any parent, not only shells. You could build handling of #! into execvp() I suppose, and then require ever program to use execvp() rather than execve() (and close relations) but don't you think that this is one place where the kernel really is the right solution. The claim of effeciency loss is largely a red herring. Most of the costs have already been born (a bad pun?) by the shell by the time it would look for the #! anyway - its done the fork, its done the path search for the exec, etc. The only thing you save is the work of the exec itself, and for a shell exec'ing itself that's not as much as you might expect. The text is going to be shared with the parent, the data space is pretty small, there just isn't all that much to do. (For csh of course this isn't true, but csh was never able to avoid the exec in any circumstances...) NB: I'm not claiming that there's no loss, just that the magnitude of the loss isn't likely to be enough to really trouble anyone. If you're writing a set of command procedures, and you know how they are going to be used (from each other) then you can always just omit the #! and have the shell operate the old way, and gain all your effeciency back. And continues... > Allowing you to unset PATH would be difficult. I'm not sure why. If you can exec a shell with no PATH set, the shell has to do something sensible (which may be defined as using a default built in PATH, or simply having no path at all and only exec'ing commands when given path names that find them). I can't see why unsetting PATH should be any different. Robert Elz seismo!munnari!kre kre%munnari.oz@seismo.css.gov