15 lines
238 B
Plaintext
15 lines
238 B
Plaintext
|
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
|