ksh script execution (Re: make importing SHELL)
Griff Smith
ggs at ulysses.homer.nj.att.com
Sun Oct 2 00:13:42 AEST 1988
In article <4273 at dunkshot.mips.COM>, dce at mips.COM (David Elliott) writes:
| In article <10669 at ulysses.homer.nj.att.com> ggs at 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 at ulysses.att.com
More information about the Comp.unix.wizards
mailing list