-
-
Save skanjo/87ce9eb3197187982df96c35b13212f9 to your computer and use it in GitHub Desktop.
sha256 command line utility
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
#!/usr/bin/env /bin/sh | |
# SHA 256 based on openssl | |
# | |
# sha256 similar to the classic "md5sum" command line | |
# | |
if [ ${#} -gt 0 ] | |
then | |
# iterate over all arguments | |
while [ ${#} -gt 0 ] | |
do | |
if [ -f $1 ] | |
then | |
openssl sha -sha256 $1 | awk '{print $2}' - | |
else | |
echo $1 does not exist. | |
fi | |
shift | |
done | |
else | |
echo $0 files... | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment