Created
February 27, 2011 17:45
-
-
Save spudtrooper/846362 to your computer and use it in GitHub Desktop.
Creates aliases for all your mac applications without name clashes. e.g. 'preview' would open '/Applications/Preview.app'. To use, add this to your .bashrc.
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
# | |
# Creates aliases for all your mac applications in $PATHS (defined | |
# below) without name clashes. e.g. 'preview' would open | |
# '/Applications/Preview.app'. To use, add this to your .bashrc. | |
# | |
# if [ -f ~/.applications.sh ]; then | |
# . ~/.applications.sh | |
# fi | |
# | |
PATHS="/Applications /Developer/Applications" | |
for p in $PATHS; do | |
for f in $p/*.app; do | |
a=`basename $f` | |
n=`echo $a | sed s/\.app// | tr '[A-Z]' '[a-z]' | tr '[. ]' '-'` | |
if [[ `which $n` == '' ]]; then | |
alias $n="open $f" | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment