lkml.org 
[lkml]   [1996]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Java and the FSSTND

> From: "James R. Leu" <jleu@coredcs.com>

> >
> > > From: "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de>
> > ...
> > >
> > > I think all "non-native machine executables" (scripts, interpreted
> > > code, etc.) should have the full name of their interpreter in them.
> >
> > I hope you don't mean the absolute pathname of the interpreter.
> > Interpreted scripts/files/whatever shouldn't have to know where
> > the interpreter is installed.
>
> Forgive me if I'm out of context, but what about #!/bin/sh at the head of all
> borne shell "interperated" scripts?

No, you haven't missed any context; that's exactly what I was talking about.


Scripts shouldn't have to have an absolute name there; it should be
indirectable, so the script doesn't depend on where the interpreter
is located (so the script will work on system with the interpreter in a
different place).

How about something like this:
- Intrepret the name after "#!" as a command to be looked up as a normal
command.
- If it's an absolute name (starting with a slash), it works the
same way as it does now.
- If it's a simple name (no slashes), it gets looked up via the
PATH environment variable (or whatever is appropriate
considering security issues).
- If it's a relative name (slashes, but no leading slash), it
get looks up relative to the current directory (or
whatever is needed for security).
- If it ever became necessary, the kernel (or whatever) could look up
simple names are map them to interpreter pathnames using
whatever mapping mechanism we wanted.


Daniel









\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.084 / U:3.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site