I tried to put the output of my program into a text file. It appends the echo commands to the file properly, but the imagemagick "compare" command is not appended to the file. It just STOUD's the "PSNR value", which is returned by compare method into terminal.
Is there a way to append this commands output to the textfile too? Also if I call my script just with "./script.sh > test.txt" it doesn't print anything more than the echos to file and compare results to terminal.
Here's a part of my code:
ls images/toconvert/ > lsout.txt
while read LINE
do
echo ====================== $LINE ==================== >> psnrdiff.txt
echo Jpeg2000 >> psnrdiff.txt
compare -metric PSNR images/toconvert/$LINE images/converted/$LINE.jp2 images/psnrDiffs/$LINE.jp2.png >> psnrdiff.txt
done < lsout.txt
for x in images/toconvert/*; do … compare -metric PSNR "$x" "images/converted/${x##*/}.jp2" "images/converted/${x##*/}.jp2.png"; done