Re: "What is the !@#$ pathname of Perl on *this* machine?"

Michael Weller (eowmob@exp-math.uni-essen.de)
Fri, 21 Feb 1997 16:57:34 +0100 (MEZ)


On 20 Feb 1997, Frohwalt Egerer wrote:

> worley@ariadne.com (Dale R. Worley) writes:
>
> Try something like #! /bin/pathexec scriptname args
>
> no pathexec does not yet exist, it remains to be written:
> - find the location of argv[1]
> - exec (location, rest-of-argv);
>
> >Of course, there are no
> >characters which are invalid for pathname (other than NUL), so we
> >still can't avoid messing up something that someone might be doing
> >somewhere.
>
> By using a user level solution you avoid kernel bloat. By using a user
> level solution you also avioid messing up with something that someone
> might be doing somewhere.

Correct. I agree wholeheartedly. And I think you even don't need pathexec.
Why not just use:

#!/shell/perl

or

#!/s/perl

And make a directory /shell or /s of (sym)links. Maybe I'm missing
something, but I don't see what would break at all. And: You don't need to
code anything. If people like your idea, it could be part of the file
system standard. And even non linux systems could be made to work with
this standard in a few secs by the administrator (admittedly, even
pathexec could be ported easily).

Of course, one could also use /bin or /usr/bin instead of /shell. And yes,
you originally complained about the fact that all distributions/installations
disagree on good locations. Thus you want the kernel handle it. But do you
really think the distributions will agree on having this driver in the
kernel AND put their shell execs in the places where the kernel awaits it
(or reconfigure the kernel interpreter?), or Joe Blow user who fails to
place a symlink /usr/bin/perl to point to its new hand installed perl
version will update and recompile the kernels #?perl interpreter ?

> A more general solution (because it is portable to platforms without
> the #! hack) is to coerce application programmers into using some tool
> that can find interpreters and fix #! lines when compiling or
> installing an application. (for example a combination of gnu autoconf
> and sed or a perl script ...)

I wrote a simple script (admittedly very limited) to do such things for
tcl/tk in scsiinfo once.

Michael.

(eowmob@exp-math.uni-essen.de or eowmob@pollux.exp-math.uni-essen.de
Please do not use my vm or de0hrz1a accounts anymore. In case of real
problems reaching me try mat42b@spi.power.uni-essen.de instead.)