Re: #!perl - alternative path to script interpreters - patch to 2.2

Jakob 'sparky' Kaivo (jake@nodomainname.net)
Wed, 24 Mar 1999 12:06:31 -0800 (PST)


If portability is key, then
#!perl
is ABSOLUTELY out of the question, as it would be a Linux-only kernel
hack. Which is what I was trying to point out in the first place.

On Tue, 23 Mar 1999, Edward S. Marshall wrote:

> On Tue, 23 Mar 1999, Jakob 'sparky' Kaivo wrote:
> > What's wrong with people following the FHS, which specifies that perl is
> > accessible at /usr/bin/perl, python at /usr/bin/python, and tcl at
> > /usr/bin/tcl?
>
> Portability, which is what started this whole discussion in the first
> place. Try taking the script:
>
> #!/usr/bin/perl -w
> print "Hello, world!\n";
>
> and running it unmodified on the multitude of UNIX variants out there.
>
> The 'eval' trick is a much more portable way of doing it:
>
> : # -*- Perl -*-
> eval 'exec perl -w -S $0 ${1+"$@"}'
> if 0;
>
> print "Hello, world!\n";
>
> More readable, no. More portable? Absolutely. You'll be hard-pressed to
> find a UNIX variant this doesn't actually run on.
>
> --
> Edward S. Marshall <emarshal@logic.net> [ What goes up, must come down. ]
> http://www.logic.net/~emarshal/ [ Ask any system administrator. ]
>
> Linux labyrinth 2.2.3-ac4 #2 Sun Mar 21 13:08:37 CST 1999 i586 unknown
> 8:05pm up 2 days, 4:26, 3 users, load average: 0.09, 0.06, 0.01
>

+-----------------------+-----------------------------+--------------------+
| Jakob 'sparky' Kaivo | jake@nodomainname.net | jake@ndn.net |
| NoDomainName Networks | http://www.nodomainname.net | http://www.ndn.net |
| AtDot E-mail Services | http://www.atdot.org +--------------------+
+-----------------------+-----------------------------+ whois jkk12 |
| Thanks to advances in shortness, I have updated my +--------------------+
| ~/.signature. Note that nodomainname can now be replaced with just ndn. |
+--------------------------------------------------------------------------+

-
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/