Path: utzoo!attcan!uunet!husc6!ukma!gatech!ulysses!ggs From: ggs@ulysses.homer.nj.att.com (Griff Smith) Newsgroups: comp.unix.wizards Subject: Re: ksh script execution (Re: make importing SHELL) Summary: don't jump on me, it wasn't my idea Message-ID: <10678@ulysses.homer.nj.att.com> Date: 1 Oct 88 14:13:42 GMT References: <452@alice.marlow.uucp> <67870@sun.uucp> <67925@sun.uucp> <4273@dunkshot.mips.COM> Organization: AT&T Bell Laboratories, Murray Hill Lines: 27 In article <4273@dunkshot.mips.COM>, dce@mips.COM (David Elliott) writes: | In article <10669@ulysses.homer.nj.att.com> ggs@ulysses.homer.nj.att.com (Griff Smith) writes: | >If $SHELL is set to point | >to ksh, a shell script can be executed by forking and interpreting the | >script in the child (don't ask about the kludges required to make this | >work reliably, I don't think I want to know). | | Kludges required to make this work reliably? How about the kludges | required to make it work correctly? | | Unless ksh tosses all aliases and functions when it starts a subshell, | [confusing execution of scripts] can happen. It does toss them, unless you "export" the aliases. This is considered to be another performance enhancement; you can avoid having to read the definitions from the .env file. I think the feature is confusing, since it promises something that can't always be delivered unless #! is outlawed and $SHELL is set to a name of ksh. If I remember correctly, V9 does export functions. Since I haven't used it, I don't know how the design avoids confused execution in naive scripts. -- Griff Smith AT&T (Bell Laboratories), Murray Hill Phone: 1-201-582-7736 UUCP: {most AT&T sites}!ulysses!ggs Internet: ggs@ulysses.att.com