Commandline output to a file?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dotdkay
Posts: 2
Joined: 2011-12-30T01:59:15-07:00
Authentication code: 8675308

Commandline output to a file?

Post 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.
User avatar
whugemann
Posts: 289
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

Re: Commandline output to a file?

Post by whugemann »

Compare writes textual output to STDERR instead of STDOUT, so you have to use "2>" instead of just ">".
Wolfgang Hugemann
dotdkay
Posts: 2
Joined: 2011-12-30T01:59:15-07:00
Authentication code: 8675308

Re: Commandline output to a file?

Post by dotdkay »

Thank you very much :)
Post Reply