Page 1 of 1

Commandline output to a file?

Posted: 2011-12-30T02:04:22-07:00
by dotdkay
Hi,
I'm comparing some images and I want the result of the image comparison output'ed to a file. I'm using Windows. For example I'm running the command:
compare -metric PSNR crop_1.png crop_2.png dif_1_2.png
Which in the console prints out:
28.9463

Normally I would put a "> result.txt" after the command, so I'll get: compare -metric PSNR crop_101.png crop_102.png dif_101_102.png > result.txt
But the problem is when I'm running that the output still get's printed in the console, but nothing in the file. I also tried with >> result.txt.
However It's working if im just doing: ping www.google.com > ping.txt

I hope some of you can help me with this problem.

Re: Commandline output to a file?

Posted: 2011-12-30T02:45:36-07:00
by whugemann
Compare writes textual output to STDERR instead of STDOUT, so you have to use "2>" instead of just ">".

Re: Commandline output to a file?

Posted: 2011-12-30T03:01:32-07:00
by dotdkay
Thank you very much :)