Skip to content

Instantly share code, notes, and snippets.

@seqizz
Last active October 1, 2016 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seqizz/db07b1c288f564cbc22d61e9a1777e77 to your computer and use it in GitHub Desktop.
Save seqizz/db07b1c288f564cbc22d61e9a1777e77 to your computer and use it in GitHub Desktop.
MD5 hash (blog)
#!/bin/ksh
ostype=`uname`
if [[ $ostype = "HP-UX" ]] ;then
echo "something" | openssl dgst -md5
elif [[ $ostype = "SunOS" ]]; then
echo "something" | digest -a md5
elif [[ $ostype = "Linux" ]]; then
echo "something" | md5sum | awk '{print $1}'
elif [[ $ostype = "AIX" ]]; then
echo "something" | csum -hMD5 - | awk '{print $1}'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment