bash - Get multiple extensions in a for loop for transforming jpg,JPG and jpeg files -
i want convert jpgs (independent lower or upper case or jpeg extension) in current directory 95% optimized one. not files correctly in loop jpg,jpg , jpeg files :/
#!/bin/bash pic=$(ls "$pwd"/*.{jpg,jpeg,jpg}) in $pic echo $i # convert $i -quality 95 ${i%.*}_resaved.jpg done
try:
find -iname "*.jpg" -o -iname "*.jpeg" | while read f; echo "$f" convert "$f" -quality 95 "${f%.*}_resaved.jpg" done
Comments
Post a Comment