gmid/regress/sha
Omar Polo 6e0f14d51e re-add sha script; it's used in the Makefile
While there, use it in the tests too
2021-10-04 09:40:05 +00:00

17 lines
285 B
Bash
Executable File

#!/bin/sh
# USAGE: ./sha in out
# writes the sha256 of in to file out
if which sha256 2>/dev/null >/dev/null; then
exec sha256 < "$1" > "$2"
fi
if which sha256sum 2>/dev/null >/dev/null; then
sha256sum "$1" | awk '{print $1}' > "$2"
exit $?
fi
echo "No sha binary found"
exit 1