Tuesday, July 24, 2007
Monday, July 23, 2007
For example ck100.Jpg -> CK100.jpg. Also removes spaces. Must be run in the directory the files are located in.
for file in *; do myfile=`echo $file | sed -e 's/ //g'`; first=`echo $myfile | sed 's/^\(.*\)\.\(.*\)/\1/'|tr '[a-z]' '[A-Z]'`; ext=`echo $myfile | sed 's/^\(.*\)\.\(.*\)/\2/'|tr '[A-Z]' '[a-z]'`; mv "$file" `echo "$first.$ext"`; done