in reply to Modifying %ENV From The Shebang Line
First, what's with env all over the place? Not only is it useless, I think it's actually hurting here. You're asking it to locate the program LD_LIBRARY_PATH=/my/lib.
Secondly, perlrun doesn't mention
#!/bin/sh -- -*- perl -*-
but it does mention
#!/bin/sh -- # -*- perl -*-
Unfortunately, that doesn't work with my sh.
However, it's easy to work around that using -x.
#!/bin/sh eval 'MYTESTVAR=/my/lib exec /usr/bin/perl -x -S $0 ${1+"$@"}' if $runningUnderSomeShell; #!perl print "[", $ENV{MYTESTVAR}, "]\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Modifying %ENV From The Shebang Line
by williams (Beadle) on Dec 17, 2007 at 23:55 UTC |