I'm using this command to recursively generate a SHA-512 hash for each file in a directory hierarchy:
find . -type f -exec openssl sha512 {} \;
I'd like to sort the files in lexicographical order before generating the hashes.
I can use sort like this:
find . -type f | sort
but I'm not sure how to then pipe the sorted file list into openssl. I tried this:
find . -type f | sort | openssl sha512
but this generates a single hash of the entire output of sort, whereas I want a hash for each individual file.
find in some versions of bash includes an -s option ("Cause find to traverse the file hierarchies in lexicographical order"), but this isn't available in my version of find.
Many thanks in advance for your help!