btclock_v3/scripts/hash.sh
2023-11-16 00:08:46 +01:00

9 lines
No EOL
454 B
Bash
Executable file

#!/bin/bash
data_directory="data/build"
# Use find to list all files in the directory (including hidden files), sort them, and then calculate the hash
#hash=$(find "$data_directory" -type f \( ! -iname ".*" \) | LC_ALL=C sort | xargs cat | shasum -a 256 | cut -d ' ' -f 1)
hash=$(find "$data_directory" -type f \( ! -iname ".*" \) | LC_ALL=C sort | xargs -I {} cat {} | shasum -a 256 | cut -d ' ' -f 1)
echo "Hash of files in $data_directory: $hash"