Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 exptools; site whuxl.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!whuxl!mike From: mike@whuxl.UUCP (BALDWIN) Newsgroups: net.unix-wizards Subject: Re: Re: Problems with System V Release 2.1 on 68010 Message-ID: <1100@whuxl.UUCP> Date: Fri, 18-Apr-86 17:43:35 EST Article-I.D.: whuxl.1100 Posted: Fri Apr 18 17:43:35 1986 Date-Received: Mon, 21-Apr-86 01:43:12 EST References: <401@oscvax.UUCP> <412@hropus.UUCP> <963@umcp-cs.UUCP> Organization: AT&T Bell Laboratories, Whippany Lines: 20 > In article <412@hropus.UUCP> ka@hropus.UUCP (Kenneth Almquist) writes: > >[`#! /bin/sh' is] a Berkeley feature. One weakness is that if > >you are running /bin/sh and invoke a shell procedure which begins > >with "#!/bin/sh", the kernel will exec /bin/sh even though /bin/sh > >is already running, so there is a cost to this approach. > > The /bin/sh that is already running would have to fork to run > the script anyway, so this `cost' really amounts to the extra > code in the kernel required to perform this indirection. > > In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415) There is a real extra cost, the exec of /bin/sh. Of course you always have to fork, but you don't have to exec. True, the text space is shared and the data space may not be too big, but the kernel has to clean up mem mgmt and then redo it, plus copying the environment. -- Michael Baldwin (not the opinions of) AT&T Bell Laboratories {at&t}!whuxl!mike