From 0aeb56da9d45820f6be62446559d8a084b95bdad Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 3 Aug 2016 17:07:45 +0100 Subject: [PATCH] mac_install_dmg --- etc/profile.d/mac.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/etc/profile.d/mac.sh b/etc/profile.d/mac.sh index 36828f10..7231056c 100644 --- a/etc/profile.d/mac.sh +++ b/etc/profile.d/mac.sh @@ -1,6 +1,7 @@ # See: http://www.infoworld.com/article/2614879/mac-os-x/top-20-os-x-command-line-secrets-for-power-users.html mac_pbcopy() { - cat $@ | ssh -q $1 -o 'ForwardAgent yes' 'cat|pbcopy' + local host="$1"; shift + cat $@ | ssh -q $host -o 'ForwardAgent yes' 'cat|pbcopy' } [ -z "$DARWIN" ] && return 0 @@ -44,3 +45,9 @@ md5sum() { mac_xmessage() { osascript -e "tell app \"System Events\" to display dialog \"$@\"" } + +mac_install_dmg() { + local MOUNTDIR=$(echo `hdiutil mount jdk-7u51-macos-x64.dmg | tail -1 | awk '{$1=$2=""; print $0}'` | xargs -0 echo) + sudo installer --verbose -pkg "${MOUNTDIR}/"*.pkg -target / + sudo hdiutil detach "${MOUNTDIR}" +} -- 2.47.3