Use find
to iterate trought all subdirectories of the given path (./
).
openssl dgst -sha256
each file in each directory and add the output to the SHA256
file in the corresponding directory.
find ./ -type d -exec sh -c 'cd "{}"; find ./ -maxdepth 1 -type f -not -name SHA256 -exec openssl dgst -sha256 \{\} + | sort -u | tee SHA256' \;
openssl dgst -sha256
each file in each directory and try to find the checksum in the SHA256
file.
find ./ -type d -exec sh -c 'cd "{}"; find ./ -maxdepth 1 -type f -not -name SHA256 -exec openssl dgst -sha256 \{\} + | grep -o "[0-9a-f]\{64\}" | grep -f - SHA256 -q || echo "$(</dev/stdin) not found in SHA list"' \;