while [ "$x" -le "$2" ] do if [ "$x" < "10" ]; then import -window $1 "capture00$x.miff"; if [ "$x" > "10" && "$x" < "100" ]; then import -window $1 "capture0$x.miff"; import -window $1 "capture$x.miff"; let x+=1; done