gmid/regress/sha

17 lines
271 B
Bash
Executable File

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