Messages in this thread | | | Date | Sun, 21 Mar 1999 09:05:57 -0500 (EST) | From | Alexander Viro <> | Subject | Re: #!perl - alternative path to script interpreters - patch to 2.2 |
| |
On Sun, 21 Mar 1999 jb@heva.net.pl wrote:
> This patch provides a way to specify alternative path to script interpreters. > > Current semantics requires to specify complete path to interpreter program in > the first line of script after #!. It is ok as long scripts are used in the > same system. In different distribution or under different OS specified path is > useless.
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).
> It is more elegant to treat word after #! as a name of language and define > directory containing links to script interpreters. This patch allows to > use #!awk, and system can be informed how to find a path for it. If interpreter > is not found on a specified path it is searched in directory defined in > /proc/sys/fs/alt-script-path kernel variable.
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.
> 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 belongs you propose to put the thing into kernel? BTW, many interpreters will barf and die on \r in the body of script. Cheers, Al (guesstimate of chances that Albert will jump in is about 7:1...)
- 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/
| |