Compare commits

..

2 Commits

Author SHA1 Message Date
stupidcomputer b834f6e76a add shebang and mass_delete 2024-07-22 14:03:45 -05:00
stupidcomputer 5f17ccf995 add a mass rename script 2024-07-22 13:47:58 -05:00
2 changed files with 27 additions and 0 deletions

11
builds/utils/mass_delete Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
temp=$(mktemp)
ls > $temp
nvim "$temp"
different=$(ls | cat "$temp" - | sort | uniq -u)
rm $different
for i in $different; do
printf "rm %i\n" "$i"
done

16
builds/utils/mass_rename Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
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