Answer the question
In order to leave comments, you need to log in
How to write to the log the output of a perl script run on the Windows command line?
There is a PERL script in which, unfortunately, there is no output of messages to the log.
I tried to run the waters like this perl script.pl -host ya.ru >out.txt
. But as soon as I added >out.txt, the script does not start.
Tell me what options are there to write everything to a file occurring on the command line, or maybe there is some kind of terminal that supports output to a file?
Answer the question
In order to leave comments, you need to log in
Redirecting to a file should work exactly as you indicated.
On the other hand, you can bring a piece of code from a perl script in which the output occurs. Maybe the script does not initially output to stdout?
put this in the script.cmd file:
perl script.pl -host ya.ru
and then from the command line run script.cmd >out.txt
If your script correctly writes to stdout, then all this will fall into out.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question