aboutsummaryrefslogtreecommitdiff
path: root/regress/sha
blob: 6fc6273a73d1e0b915c51d88657ef811d11b2fce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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