diff --git a/regress/sha b/regress/sha index 02b8eb2..6fc6273 100755 --- a/regress/sha +++ b/regress/sha @@ -3,11 +3,11 @@ # USAGE: ./sha in out # writes the sha256 of in to file out -if which sha256 2>/dev/null >/dev/null; then +if command -v sha256 >/dev/null; then exec sha256 < "$1" > "$2" fi -if which sha256sum 2>/dev/null >/dev/null; then +if command -v sha256sum >/dev/null; then sha256sum "$1" | awk '{print $1}' > "$2" exit $? fi