Created
December 30, 2011 18:00
-
-
Save maxcutler/1540832 to your computer and use it in GitHub Desktop.
Daniel startup script iterations
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
----------------------- | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also leverage the "application" flag which is smart enough to recursively search both /Applications and ~/Applications ...