@b0rk_reruns for the loop example, I'd use ${i//.png/.jpg} to replace extension or ${i%%.*} to remove extension.