btclock_v3/scripts/hash.sh

9 lines
454 B
Bash
Raw Normal View History

2023-11-15 23:08:46 +00:00
#!/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"