Subject: extending the kernel interpreter exec() mechanism
To: None <current-users@NetBSD.ORG>
From: Greg A. Woods <woods@kuma.web.net>
List: current-users
Date: 12/15/1997 15:44:31
[ On Sun, December 14, 1997 at 18:21:07 (-0500), Nathan J. Williams wrote: ]
> Subject: Re: NetBSD master CVS tree commits
>
> The solution I see to this problem, long-term, is to extend
> the kernel's and the shell's exec*() mechanisim to look up the string
> after #! in a database and do some kind of mapping. A simple database
> could have useful things like ("/usr/bin/perl" ->
> "/usr/pkg/bin/perl"), or eventually some non-pathname mappings like
> ("-perl5" -> "/usr/pkg/bin/perl"), so that people can write "#!-perl5"
> scripts and have them generally work. Conveniently, #!x, where x is
> not /, is not generally useful, and can be co-opted to this purpose.
This sounds OK. Depending on where/how the mapping is programmed into
the kernel. (BTW, no shell should normally know about this mechanism
when the kernel does.)
Just don't forget to get it right w.r.t. the now optional space before
the '/'. Remember that it was once the 32-bit magic number formed by
the complete string "#! /". I would suggest keeping the option of
having a space after the '!', but what's important is not to break the
current option of having a space between the '!' and the '/'. MANY
scripts still depend on the really traditional mechanism.
[Personally I'd be quite happy to require the space again too! ;-)]
--
Greg A. Woods
+1 416 443-1734 VE3TCP robohack!woods
Planix, Inc. <woods@planix.com>; Secrets Of The Weird <woods@weird.com>