Created
December 1, 2017 15:30
-
-
Save iholler/271ec3ca2e7815fafb6faf03efc91bb1 to your computer and use it in GitHub Desktop.
Bash function to change the extension on all files in current folder.
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
function chext() { | |
origExt=$1 | |
newExt=$2 | |
for f in *"${origExt}"; do | |
mv -- "$f" "${f%.$origExt}.$newExt" | |
done | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment