Skip to content

Instantly share code, notes, and snippets.

@maxcutler
Created December 30, 2011 18:00
Show Gist options
  • Save maxcutler/1540832 to your computer and use it in GitHub Desktop.
Save maxcutler/1540832 to your computer and use it in GitHub Desktop.
Daniel startup script iterations
-----------------------
Original:
-----------------------
#!/bin/bash
# Open all of the requisite applications
echo 'Opening Chrome'
`open /Volumes/Macintosh\ HD/Applications/Google\ Chrome.app/`
echo 'Opening Skype'
`open /Volumes/Macintosh\ HD/Applications/Skype.app/`
echo 'Opening Sparrow'
`open /Volumes/Macintosh\ HD/Applications/Sparrow.app/`
echo 'Opening Linkus'
`open /Volumes/Macintosh\ HD/Applications/Linkinus.app/`
echo 'Opening Adium'
`open /Volumes/Macintosh\ HD/Applications/Adium.app/`
-----------------------
Using variables + loop:
-----------------------
#!/bin/bash
apps_path="/Volumes/Macintosh HD/Applications/"
apps=("Google Chrome" "Skype" "Sparrow" "Linkinus" "Adium")
for app in "${apps[@]}"; do
echo "Opening ${app}"
open "${apps_path}${app}.app"
done
@rhlrx85
Copy link

rhlrx85 commented May 14, 2012

You can also leverage the "application" flag which is smart enough to recursively search both /Applications and ~/Applications ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment