[BACK]Return to md5.sh CVS log [TXT][DIR] Up to [local] / OpenXM / src / util

Annotation of OpenXM/src/util/md5.sh, Revision 1.2

1.1       ohara       1: #!/bin/sh
1.2     ! ohara       2: # $OpenXM: OpenXM/src/util/md5.sh,v 1.1 2006/10/13 11:51:25 ohara Exp $
1.1       ohara       3:
                      4: _freebsd () {
                      5:        if [ "`which md5`" ]; then
1.2     ! ohara       6:                md5 "$@"
1.1       ohara       7:        fi
                      8: }
                      9:
                     10: _linux () {
                     11:        if [ "`which md5sum`" ]; then
1.2     ! ohara      12:                md5sum "$@" | sed -e 's/^\([0-9a-f]*\)  \(.*\)$/MD5 (\2) = \1/'
1.1       ohara      13:        fi
                     14: }
                     15:
                     16: _other () {
                     17:        if [ "`which md5sum`" ]; then
1.2     ! ohara      18:                md5sum "$@" | sed -e 's/^\([0-9a-f]*\)  \(.*\)$/MD5 (\2) = \1/'
1.1       ohara      19:        elif [ "`which md5`" ]; then
1.2     ! ohara      20:                md5 "$@"
1.1       ohara      21:        fi
                     22: }
                     23:
                     24: case "`uname`" in
1.2     ! ohara      25: *BSD)  _freebsd "$@" ;;
        !            26: Linux) _linux   "$@" ;;
        !            27: *)     _other   "$@" ;;
1.1       ohara      28: esac

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>