mirror of
https://github.com/bytedream/scripts.git
synced 2025-05-09 20:25:12 +02:00
Extended README.md and removed unwanted output
This commit is contained in:
parent
a22bdf470c
commit
67207b367d
@ -1,6 +1,7 @@
|
||||
## Hashify Filename
|
||||
|
||||
With this little script you can rename given files to its [MD5](https://en.wikipedia.org/wiki/MD5) hashsum. File extension won't be changed.
|
||||
This little script renames given files to its [MD5](https://en.wikipedia.org/wiki/MD5) hashsum. File extension won't be changed.
|
||||
This allows duplicate files in the same directory to be easily detected and merged / overwritten.
|
||||
|
||||
This script is just a fork of [randomize-filename](../randomize-filename).
|
||||
|
||||
|
@ -38,7 +38,9 @@ function rename() {
|
||||
continue
|
||||
fi
|
||||
filename="$(md5sum $filepath | awk '{print $1}')$ext"
|
||||
mv "$filepath" "$base/$filename"
|
||||
if [ $file != $filename ]; then
|
||||
mv -f "$filepath" "$base/$filename"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user