Skip to content

Instantly share code, notes, and snippets.

@actuosus
Created April 25, 2017 13:56
Show Gist options
  • Save actuosus/2e88ae7b861b3f79cd2dddbe043b3d11 to your computer and use it in GitHub Desktop.
Save actuosus/2e88ae7b861b3f79cd2dddbe043b3d11 to your computer and use it in GitHub Desktop.
Detect macOS and fallback md5sum
# Detect OS
OS="`uname`"
case $OS in
'Linux')
OS='Linux'
alias ls='ls --color=auto'
;;
'FreeBSD')
OS='FreeBSD'
alias ls='ls -G'
;;
'WindowsNT')
OS='Windows'
;;
'Darwin')
OS='Mac'
;;
'SunOS')
OS='Solaris'
;;
'AIX') ;;
*) ;;
esac
md5sum="md5sum"
if [[ ${OS} == 'Mac' ]]; then
md5sum="md5 -r"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment