Last active
October 7, 2015 04:28
-
-
Save esbullington/3105926 to your computer and use it in GitHub Desktop.
Quick and easy command line script to compare sha1sum of a file and the sha1sum string (eliminates need to create a file)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ $(sha1sum /path/to/file/to/check.txt | awk '{printf "%s", $1}') = "1a5091_SHA1_TO_CHECK_443234" ] && echo "Pass: sha1sum match" || echo "Warning: no match" |
Updated md5sum to sha1sum, a more appropriate hashing algorithm for the present day.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oddly, there seems to be no easy way to compare an md5sum string with a calculated md5sum on Linux without creating a file (i.e., "md5sum -c /file/name"), so I use this script, which can be run directly on the command line (no need to create and run a separate bash file).