lkml.org 
[lkml]   [1999]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: #!perl - alternative path to script interpreters - patch to 2.2


On Sun, 21 Mar 1999 jb@heva.net.pl wrote:

>
> > Under different OS you will not have your hack in the kernel, so
> > your solution has *less* chances to work there (zero, to be precise).
>
> But script written under different OS will work under linux without
> change.

And script written under Linux and using that feature will break
*everywhere* else. Fun, fun...

> > > It is more elegant to treat word after #! as a name of language...
> > It is *completely* non-portable. Moreover, it will be useless for
> > situations when different names are used for different versions of
> > aforementioned awk (gawk vs. mawk). If you have permissions to tweak
> > sysctls (aka /proc/sys) you have permissions to create a symlink.
>
> Script may specify /opt/new-language/bin/sth while your comp may not
> have /opt directory tree at all - its ugly. This patch provides
> centralized way to redirect interpreter execution.

Excuse me? If you can set sysctls (root-only, otherwise I'll just
reassign the path for sh and wait until the next cron task will run it. As
root) you can set symlinks. Or fix the frigging script, in the first
place. If you are installing the package into unusual place you can bet
that name of interpreter will not be the only thing you'll have to change.
BTW, what will you do with /opt/new-language/bin/make? Or
/opt/new-langauge/bin/logout, for that matter ;-/

> It takes about 300 bytes (code overhead is smaller).
>
> > > This patch also fixes problems with scripts that come from DOS environment
> > > ('\r\n' as line delimiter).
> > Erm??? That is, instead of tr -d "\015" in userland where it..
>
> OK. But you have to change script. More: you have to know nature of a
> problem (to remove '\r') - kernel will not tell you what is going wrong.
Sorry, but you've missed the interesting part of it. For example,
perl will react on \r in the script in funny way. You will have to remove
that stuff anyway.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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