Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shacomp() {
- if [ ! -z $1 ] ; then
- echo "Comparing $1 with sha1 hash $2"
- SHA=$(shasum $1 | awk '{ printf $1 }')
- if [ SHA = $2 ] ; then
- echo "$1 and $2 are same"
- else
- echo "$1 and $2 are not the same ($1 = $SHA)"
- fi
- else
- echo "usage: shcomp <file> <sha1>"
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement