daily pastebin goal
51%
SHARE
TWEET

Untitled

TuxyQ Mar 1st, 2012 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. shacomp() {
  2.         if [ ! -z $1 ] ; then
  3.                 echo "Comparing $1 with sha1 hash $2"
  4.                 SHA=$(shasum $1 | awk '{ printf $1 }')
  5.                 if [ SHA = $2 ] ; then
  6.                         echo "$1 and $2 are same"
  7.                 else
  8.                         echo "$1 and $2 are not the same ($1 = $SHA)"
  9.                 fi
  10.         else
  11.                 echo "usage: shcomp <file> <sha1>"
  12.         fi
  13. }
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top