hash_filename

This script will rename a given file; the new filename will have a hash inserted, e.g.:

test.txttest.da39a3e.txt

Use the optional second parameter -e to print the new filename to stdout.

Usage

$ scripts/general/hash_filename.sh test.txt
$ scripts/general/hash_filename.sh test-echo.txt -e
test-echo.da39a3e.txt
$ find . \( -type f -name '*.jpg' -o -name '*.png' \) \
-exec scripts/general/hash_filename.sh {} \;