Last active
July 2, 2025 12:22
-
-
Save syaifulsz/5c808f13c48d07d4fc9c9fc7066aeb65 to your computer and use it in GitHub Desktop.
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
rename_f() | |
{ | |
local nameprefix="$1"; | |
local fext="$2"; | |
idx=0; | |
for f in *.$fext; do | |
((idx++)); | |
idxstr=$(printf %02d $idx); | |
fnameneo="$nameprefix$idxstr.$fext"; | |
echo -e "File Name Old : $f"; | |
echo -e "File Name New : $fnameneo"; | |
echo -e; | |
mv "$f" "$fnameneo"; | |
done | |
} | |
# example usage | |
rename_f "Dexter New Blood " "mp4"; | |
rename_f "Dexter New Blood " "srt"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment