Last active
September 17, 2019 05:48
-
-
Save woodRock/f9d26b2cf39e89b79b931759b539f9ed to your computer and use it in GitHub Desktop.
Rename a episodes in a folder for a season
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
a=1 | |
for i in *.mkv; do | |
placeholder="" | |
if [ "$a" -lt 10 ] | |
then | |
placeholder="0" | |
fi | |
new=$(printf "Episode-%s%d.mkv" "$placeholder" "$a") | |
mv -i -- "$i" "$new" | |
let a=a+1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment