From: Gurusamy Sarathy Date: Sun, 6 Jul 1997 00:10:22 +0000 (+1200) Subject: Minor fix for pl2bat.bat X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=68d58bca0a3bd388198ebac3493f3709490347a0;p=p5sagit%2Fp5-mst-13.2.git Minor fix for pl2bat.bat A long time ago, on Tue, 24 Jun 1997 12:02:25 PDT, Warren Jones wrote: >Scripts created by pl2bat pass themselves to perl with "perl -x -X %0.bat". >Adding the ".bat" extension to %0 is unnecessary, since "perl -S" will >try this automatically. It makes the script impossible to run from >the MKS Korn shell, since that shell alway invokes batch files using >the full path and ".bat" extension. Thus perl ends up getting a file >name with *two* ".bat" extensions (foo.bat.bat) which doesn't work. >A patch follows. > >Also, does anyone know why pl2bat uses "%1 %2 %3 ..." rather than %* ? >Admittedly, all this dosish foolery is pretty lame. %* does not work with 4DOS/NT. I just found out it can be made to work there by setting C in the 4nt.ini file. Since using %* eliminates the 9 arg limit for perl bat files, I recommend this patch (which includes yours). Credited: Warren Jones p5p-msgid: 199707061843.OAA23874@aatma.engin.umich.edu --- diff --git a/win32/bin/pl2bat.bat b/win32/bin/pl2bat.bat index 7f5f39a..f9b4902 100644 --- a/win32/bin/pl2bat.bat +++ b/win32/bin/pl2bat.bat @@ -1,6 +1,6 @@ @rem = '--*-Perl-*-- @echo off -perl -x -S %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 +perl -x -S %0 %* goto endofperl @rem '; #!perl -w @@ -8,7 +8,7 @@ goto endofperl (my $head = <<'--end--') =~ s/^\t//gm; @rem = '--*-Perl-*-- @echo off - perl -x -S %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 + perl -x -S %0 %* goto endofperl @rem '; --end--