add a mass rename script

This commit is contained in:
stupidcomputer 2024-07-22 13:47:58 -05:00
parent c23635a853
commit 5f17ccf995
1 changed files with 14 additions and 0 deletions

14
builds/utils/mass_rename Executable file
View File

@ -0,0 +1,14 @@
temp=$(mktemp)
ls > $temp
nvim $temp
results=$(ls | paste -d'|' - $temp)
IFS="
"
for i in $results; do
before="${i%%|*}"
after="${i#*|}"
[ "$before" != "$after" ] && mv "$before" "$after"
printf "%s -> %s\n" "$before" "$after"
done