develooper Front page | perl.perl5.porters | Postings from December 2004

[perl #32979] [PATCH] perlrun #!/bin/sh incantation n.g. 4 linux

From:
Steve Peters via RT
Date:
December 21, 2004 09:36
Subject:
[perl #32979] [PATCH] perlrun #!/bin/sh incantation n.g. 4 linux
Message ID:
rt-3.0.11-32979-103402.11.4873424142094@perl.org
> [brucer@cisco.com - Thu Dec 09 11:41:30 2004]:
> 
> 
> This is a bug report for perl from brucer@iceage.cisco.com,
> generated with the help of perlbug 1.35 running under perl v5.8.6.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> perlrun incantation:
> 
> #!/bin/sh -- # -*- perl -*- -p
> eval 'exec perl -wS $0 ${1+"$@"}'
> if $running_under_some_shell;
> 
> does not work
> 
> What does work is:
> 
> #!/bin/sh
> #! -*- perl -*-
> eval 'exec perl -x -wS $0 ${1+"$@"}'
>  if 0;
> 
> found at http://lists.gnu.org/archive/html/bug-bash/2001-
>    07/msg00070.html
> 
> This works on both solaris2.8 (ours anyway) and linux
> 
> thanks,
> Bruce
> 

The following patch to perlrun.pod applies the change suggested above.

--- perlrun.pod.orig    Tue Dec 21 11:32:41 2004
+++ perlrun.pod Tue Dec 21 11:34:34 2004
@@ -79,9 +79,10 @@
 The sequences "-*" and "- " are specifically ignored so that you could,
 if you were so inclined, say

-    #!/bin/sh -- # -*- perl -*- -p
-    eval 'exec perl -wS $0 ${1+"$@"}'
-        if $running_under_some_shell;
+    #!/bin/sh
+    #! -*-perl-*-
+    eval 'exec perl -x -wS $0 ${1+"$@"}'
+        if 0;




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About