dot_testing/builds/utils/mass_rename

17 lines
249 B
Plaintext
Raw Permalink Normal View History

2024-07-22 14:03:45 -05:00
#!/bin/sh
2024-07-22 13:47:58 -05:00
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