Created
August 17, 2012 15:51
-
-
Save cargowire/3380076 to your computer and use it in GitHub Desktop.
Rename files by adding a suffix after a fixed number of characters from the original string (assumes no '.' in filenames)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in *.$1; | |
do | |
IFS="." read -ra parts <<< "$i" | |
mv $i ${parts[0]:0:$3}$2.${parts[1]}; | |
unset IFS | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment