SEARCH_DIR="$1" NEW_SIZE="$2" for x in "`find "$SEARCH_DIR" -type f`"; do echo "$x" # convert "$x" -resize "$NEW_SIZE\>" "${x%.jpg}.new"; done