Created
April 25, 2017 13:56
-
-
Save actuosus/2e88ae7b861b3f79cd2dddbe043b3d11 to your computer and use it in GitHub Desktop.
Detect macOS and fallback md5sum
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
# 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