Batch conversion of jpg files to png
January 23rd, 2007 by RohanMake 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
