Last active
September 11, 2018 11:53
-
-
Save photonxp/3d30689ba49ade34d7691be3f771e873 to your computer and use it in GitHub Desktop.
compare generated-sha1sum of a given file to a sum_string
This file contains hidden or 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
#!/bin/bash | |
# Usage: | |
# sha1sum_file_vs_sumstr.sh /path/to/file sum_str | |
sha1sum "$1" | |
sha1_result=$(sha1sum "$1") | |
sum=${sha1_result%% *} | |
echo | |
echo $sum | |
diff <(echo $sum) <(echo $2) && echo "Compare is OK." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment