-
-
Save bergginu/1da44dcec35f85a5cddfa4d044d5756f to your computer and use it in GitHub Desktop.
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 | |
Help() | |
{ | |
echo 'Computes the md5 hash of a string.' | |
echo | |
echo 'Usage:' | |
echo ' md5 -h' | |
echo ' md5 string' | |
echo | |
} | |
while getopts ":h" option; do | |
case $option in | |
h) #display help | |
Help | |
exit;; | |
esac | |
done | |
echo -n $1 | md5sum -t | awk '{print $1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For Linux SysAdmns that handle MD5 (passwords, i.g.), as a safer alternative than online tools.
A good practice is to put it in the ~/.local/bin directory.