#!/bin/sh UFILES=0 CFILES=0 COUNT=0 find . -maxdepth 1 | while read file do # First translate the unwanted characters to "!". NEWNAME=$(echo $file |tr ",\"[]() [:upper:]" "!!!!!!![:lower:]") # Then remove the unwanted characters. SHORTNAME=$(echo $NEWNAME |tr -d "!") if [ "$file" == "$SHORTNAME" ] then UFILES=`expr $UFILES + 1` COUNT=`expr $COUNT + 1` if [ $COUNT -gt 9 ] then echo "Processed $CFILES files, skipped $UFILES files." COUNT=0 fi else echo "converting $file [$CFILES]" mv "$file" "$SHORTNAME" CFILES=`expr $CFILES + 1` fi done #echo "Converted $CFILES and skipped $UFILES files in current directory."