#! troubles

Spencer Garrett srg at quick.COM
Wed Jan 17 15:43:45 AEST 1990


In article <1990Jan15.215617.9659 at i88.isc.com>, daveb at i88.isc.com (Dave Burton) writes:
> In article <2047 at uvaarpa.virginia.edu> worley at compass.com writes:
> >> Assuming the kernel gets your $PATH (which it doesn't, but pretend) -
> >
> The kernel does not get _any_ environment variables. Sure, it passes an
> environment pointer to the exec'd process, but this does not imply the
> environment is scanned. That would be _very_ expensive.

Au contraire.  The environment strings are *copied* to the child process
in the same manner as the argv strings.  The kernel could easily scan
for a PATH variable.  The main argument against this is that it's the
sort of feeping creaturism for which Berkeley has been long and loudly
chastized, though given that #! interpretation got moved in I don't
see this as an inappropriate adjunct.  I think it got left out mostly
because coding this sort of thing at the kernel level is a mess.



More information about the Comp.unix.questions mailing list