Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch a dmg one by one in MAC OSX using Shell? [closed]

Tags:

bash

shell

sh

macos

I am using MAC OSX 10.8 Mountain Lion.

I am preparing a Shell Script to launch 3 dmg files one by one.

I want to launch the dmg file each one after the another dmg has been installed.

I am using the wait function in script, but it is waiting till one dmg has been closed.

Please suggest any solutions.

like image 885
user3214224 Avatar asked Feb 27 '14 11:02

user3214224


1 Answers

here's a way you can open dmg files, copy the app and unmount the volume, for each volume:

for f in *.dmg: do
    VOLUME=$(hdiutil attach "$f" | tail -1 | awk '{print $3}')
    cp -r "$VOLUME/"*.app /Applications/
    diskutil unmount "$VOLUME"
done

to be ran in the directory of the dmg files.

like image 120
zmo Avatar answered Oct 17 '22 09:10

zmo