|
From: | Paolo Bonzini |
Subject: | Re: Explicit interpreter paths considered harmful |
Date: | Fri, 30 Oct 2009 16:02:15 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4 |
On 10/30/2009 01:38 PM, Eric Blake wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Jim Meyering on 10/30/2009 6:29 AM:+eval '(exit $?0)'&& eval 'exec perl -wS "$0" ${1+"$@"}' +& eval 'exec /usr/bin/perl -wS "$0" $argv:q'shouldn't that be perl, rather than /usr/bin/perl?I could not arrange for that 2nd eval line to make a difference, so figured it'd be best to leave it as is.Did you try: tcsh ./script? I'm wondering if that second eval is catering to users who run SHELL=tcsh, since the script no longer has a shebang, and tcsh has different rules on how to attempt scripts that lack a shebang.
Yeah, that looks like it. The "if $running_under_shell" to "if 0" is a change that I did too yesterday.
I'd also change -wS to -S since the script can "use warnings" if it wants, but shouldn't be forced to. Some other scripts use -0777 or -T.
In the end that would be eval '(exit $?0)'&& eval 'exec perl -S "$0" ${1+"$@"}' & eval 'exec perl -S "$0" $argv:q' if 0; Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |