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
|
## 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).
|
This script is just a fork of [randomize-filename](../randomize-filename).
|
||||||
|
|
||||||
|
@ -38,7 +38,9 @@ function rename() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
filename="$(md5sum $filepath | awk '{print $1}')$ext"
|
filename="$(md5sum $filepath | awk '{print $1}')$ext"
|
||||||
mv "$filepath" "$base/$filename"
|
if [ $file != $filename ]; then
|
||||||
|
mv -f "$filepath" "$base/$filename"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user