develooper Front page | perl.perl5.porters | Postings from November 2008

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

Thread Next
From:
Steve Peters via RT
Date:
November 27, 2008 01:33
Subject:
[perl #32979] perlrun #!/bin/sh incantation n.g. 4 linux
Message ID:
rt-3.6.HEAD-10965-1227765166-1294.32979-15-0@perl.org
On Tue Dec 21 09:36:12 2004, stmpeters wrote:
> > [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;


Thanks!  Applied as change #34943.

Steve Peters

Thread Next


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