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

The real solution, as it has been since before Linux was even around, is that
if you don't know where perl is installed, you make the thing #!/bin/sh and
call perl on itself;

It goes something like...

===
#!/bin/sh

eval 'exec perl -w -S $0 ${1+"$@"}'
if 0;
===

perl sees the 'if 0' on the next line and knows not to do anything.
the shells just execute the first line without looking at the second one.

(grabbed from a random perl script called "HEAD" on my system, I'm sure
it can be found in thousands)

The problem has been solved for years. Use the existing solution.

David.


-
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:0.082 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site