Last active
August 29, 2015 14:02
-
-
Save newsroomdev/2e2d8eabf4a5fb7e4e3b to your computer and use it in GitHub Desktop.
ReBasename
This file contains 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
# ReBasename | |
# A simple script to iteratively create a new basename for files based on their extensions | |
# | |
# rebasename [file ext] [basename] | |
# | |
# Todo: | |
# increment argument | |
function rebasename() { | |
n=0; | |
for file in *."$1" ; do mv "${file}" "$2""${n}"."$1"; n=$((n+1)); done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment