-
-
Save alpha1125/45072f4a06afd63af34f3714a5205c6a to your computer and use it in GitHub Desktop.
Bash script to fetch the sha256 value from a given 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
#!/usr/bin/env bash | |
string="9988776: digest: sha256:994d99f0d06024acfeb99bb393dc9907d80d6bf5b49e29e313a037580f1a9b07 size: 1337" | |
echo "the sha is: $string" | sed 's/.*digest: sha256:\([a-f0-9]*\) size:.*/\1/' | |
## echo's out 994d99f0d06024acfeb99bb393dc9907d80d6bf5b49e29e313a037580f1a9b07 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment