Last active
December 24, 2015 01:59
-
-
Save tonussi/6727161 to your computer and use it in GitHub Desktop.
rename.sh
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
#!/bin/sh | |
echo "Write the string extention ( ie .bash )\n" | |
echo "The program will accept multiple extention. ( ie .html.markdown )\n" | |
read oldext # = ".html.markdown" | |
echo "Write the new extention ( ie .sh )" | |
read newext # = ".md" | |
for file in *$oldext | |
do | |
echo file | |
cp ${file} ${file%$oldext}$newext | |
done | |
done | |
# Ele faz para arquivos escritos na forma [a-z]*U[0-9]*.[a-z]*U[0-9]* | |
# Mas para caracteres especiais está travando | |
# Por exemplo arquivos chamados: | |
# a.b | |
# a (3rd copy).b | |
# a (4th copy).b | |
# a (5th copy).b | |
# a (another copy).b | |
# a (copy).b | |
# Ele não trabalha. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment