#!/bin/sh
# the following will resize all "png" and "jpg" to 50%
#ex: resize.sh 50 png jpg

p100=$1; shift

for j in [email protected]
do

files=./*$j

for i in $files
do
	if [ -f "$i" ]
	then
		base=${i%.*}
		ext=${i##*.}
		echo resizing: "$i"
		convert -resize $p100% "$i" "$base-rdx$p100.$ext"
	fi
done
done