Batch conversion of jpg files to png

January 23rd, 2007 by Rohan

Make use of bash substring removal

$ for i in *.jpg; do j=${i%.jpg}.png; convert $i $j; done

This, ${i%.jpg} strips the trailing “.jpg” substring from variable i

Need more? Advanced Bash-Scripting Guide

[Post to Twitter] Tweet This Post  [Post to Facebook] Facebook 

Leave a Reply




Tweet This Post links powered by Tweet This v1.4.1, a WordPress plugin for Twitter.