Last active
May 31, 2024 08:59
-
-
Save Starou/fd0f7401cc9fad0dfeb26ec3d0c38a79 to your computer and use it in GitHub Desktop.
Change the prefix of a bunch of files in Git.
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
#!/usr/bin/env sh | |
rx='(FMPLF)(.*)' | |
for f in FMPLF_SC_* | |
do | |
[[ "$f" =~ $rx ]] | |
new_f="${BASH_REMATCH[1]}_D${BASH_REMATCH[2]}" | |
echo "mv $f with $new_f" | |
git mv $f $new_f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment