commit 12fcba2f80034356e75d73380d22012fd72476a8 from: Omar Polo date: Sun Feb 27 16:24:45 2022 UTC use shell built-in `command' instead of which(1) it's specified by POSIX AFAIK and requires less redirections. commit - cd3e28ffe4e39716849cb289f3bb0cf76634fbc3 commit + 12fcba2f80034356e75d73380d22012fd72476a8 blob - 02b8eb211eb3c2d1e7d2f072d17e8b98173bacf1 blob + 6fc6273a73d1e0b915c51d88657ef811d11b2fce --- regress/sha +++ 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