On Wed, Mar 05 2014, David Bremner <david at tethera.net> wrote: > Tomi Ollila <tomi.ollila at iki.fi> writes: >> >> (IIRC openssl sha256 is available at least in Mac OS X, probably in other >> BSD:s & Solaris too) >> > > OTOH sha256sum is in coreutils, so everywhere with a gnu userland has > it. Some might not have openssl (it's priority optional on Debian, > e.g.).
Aaah these response times are a pleasure... :D cd $TEST_DIRECTORY/test-databases if hash sha256sum 2>/dev/null then sha256sum --quiet --check ${dbtarball}.sha256 || error "checksum of database failed" else # opportunistically try to run openssl sha256 in case sha256sum is not available read sha256sum_exp filename < ${dbtarball}.sha256 sha256sum_act=`openssl sha256 "${dbtarball}" | sed 's/ .*//'` test "$sha256sum_exp" = "$sha256sum_act" || error "checksum of database failed" fi cd - >& /dev/null > > d Tomi