#!/usr/bin/env etsh : : etsh - " Force sh(1), csh(1), and other shells to exit w/ error! " <'' ;;; : : " @(#)$Id: 1023a60eefe41395fd7280b43e93ca6ec1f8987e $ " : : " The author of this file, J.A. Neitzel , " : " hereby grants it to the public domain. " : : : " Calculate and print a list of checksums (md5, sha1, rmd160, sha256, " : " sha512) for the specified readable, regular file(s). " : : " usage: mksums file [...] " : : " Check for correct usage. " : >>$0'' <'' ; killer $0 mksums if $# = 0 if { exit } pusage $0 '"file [...]"' : Loop : >>$1'' <'' if ! \( -r $1'' -a -f $1'' \) goto BadFile ( \ openssl dgst -md5 $1 ; openssl dgst -sha1 $1 ; \ openssl dgst -ripemd160 $1 ; openssl dgst -sha256 $1 ; \ openssl dgst -sha512 $1 \ ) | sed 's/IPE// ; s/(/ (/ ; s/)/) /' echo -n 'SIZE ('$1') = ' ls -Ll $1 | awk '{ print $5 }' ; shift if $# = 0 exit goto Loop : BadFile perror $0 $1'": cannot open"' ; shift if $# = 0 if { exit } false goto Loop