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