Skip to content

Instantly share code, notes, and snippets.

@orymate
Created July 14, 2010 06:41
Show Gist options
  • Save orymate/475106 to your computer and use it in GitHub Desktop.
Save orymate/475106 to your computer and use it in GitHub Desktop.
#!/bin/bash
ECHO=echo
if [ "x$DISPLAY" != x ]
then
if type -P zenity &>/dev/null
then
ECHO='zenity --info --text'
elif type -P xmessage &>/dev/null
then
ECHO='xmessage'
else
echo 'wtf :('
fi
fi
while [ "x$1" != x ]
do
cd "$(dirname "$1")"
if grep -q SHA1 <<<"$1"
then
$ECHO "$(sha1sum -c $1)"
elif grep -q MD5 <<<"$1"
then
$ECHO "$(md5sum -c $1)"
else
$ECHO "What is $1?"
fi
shift
cd -
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment