mjrCSUM.sh

#!/bin/bash

# Very inefficient way to compute the MD5, SHA1, line count,
# character count, and binary character count for a file.  It
# reads the file FOUR times!!!  Still, it's easy to code up... :)
#
# Out is: "MD5 SHA1 LINE_COUNT CHAR_COUNT BIN_CHAR_COUNT FILE_NAME"

echo `date +%s`                                         \
     `stat -c "%Da %Dc %Dm" "$1"`                       \
     `openssl dgst -hex -md5  "$1" | sed 's/(.*)= /:/'` \
     `openssl dgst -hex -sha1 "$1" | sed 's/(.*)= /:/'` \
     `tr -d "[:print:][:space:]" < "$1" | wc -c`        \
     `wc -l -c "$1"`

Generated by GNU Enscript 1.6.5.2.