Re: redirection problem
by Corion (Patriarch) on Jun 22, 2012 at 09:56 UTC
|
I'm not sure whether the following threads have a solution for you, but the issue came up with Windows 7 and (64-bit) Perl / path extensions:
| [reply] |
|
Yes, it is unfortunate that the claim of finding the cause stands and that the follow-on discussion doesn't make it clear that that conclusion was in error. I would've made that point more forcefully but I was treading carefully, hoping to avoid an explosive denial and hoping to gently solicit a re-examination and thus a realization and admission.
If you read the whole thread carefully, you can see that the conclusion is disproved and also what the real source for the conclusion (likely) was. So I consider this specific problem no better understood.
Here's hoping that this round of investigation can come to a more useful conclusion.
| [reply] |
Re: redirection problem
by BrowserUk (Patriarch) on Jun 22, 2012 at 09:08 UTC
|
C:\test>assoc .pl
.pl=Perl
C:\test>ftype Perl
Perl="c:\perl64\bin\perl.exe" "%1" %*
Note: The argument to the second command comes from whatever is after the '=' in the output from the first.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
| [reply] [d/l] |
|
| [reply] |
|
C:\test>set pathext
PATHEXT=.pl;.COM;.EXE;.BAT;.CMD;
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
| [reply] [d/l] |
|
|
|
Re: redirection problem
by Happy-the-monk (Canon) on Jun 22, 2012 at 09:04 UTC
|
What can be the reason, that
script.pl > output.txt
creates empty file output.txt and
perl script.pl > output.txt
creates output.txt with data produced by script.pl?
Does the execution of the first command produce any errors on STDERR (the cmd/dosbox/shell/terminal)?
What does the first line of script.pl look like?
What kind of a shell/terminal are you using?
Cheers, Sören
| [reply] |
|
No, there are no errors on STDERR:
C:\>type script.pl
#!perl
print 'abc'
C:\>script.pl > noperl.txt
C:\>perl script.pl > perl.txt
C:\>type noperl.txt
C:\>type perl.txt
abc
C:\>assoc .pl
.pl=Perl
C:\>ftype Perl
Perl="C:\Perl64\bin\perl.exe" "%1" %*
I use standard Windows console. | [reply] [d/l] |
|
#!/usr/bin/perl --
use strict; use warnings;
use File::Find::Rule;
use Env qw/ @PATH /;
use Data::Dump;
dd( find( 'file', 'name', qr/script/i, 'maxdepth', 1, 'in', \@PATH));
__END__
| [reply] [d/l] [select] |
|
Re: redirection problem
by pvaldes (Chaplain) on Jun 22, 2012 at 11:23 UTC
|
because script.pl is not a command recognizable to bash and returns false/null probably, so nothing is printed in the output file
I use standard Windows console
I missed this line, forget all said then
| [reply] |
|
Yeah, if you follow Corions links, you can examples of the error message win32 generates, like this
$ nonsense > NUL
'nonsense' is not recognized as an internal or external command,
operable program or batch file.
| [reply] [d/l] |