Search code examples
excelmacosbashaliasdarwin

Why does my alias not work for Excel on Mac OSx?


I am in Darwin Kernel 14.3.0 and I want to create an alias for launching excel. Here's what I added to my .bashrc file:

alias excel=‘/usr/bin/open /Applications/Microsoft\ Office\ 2011/Microsoft\ Excel.app/Contents/MacOS/Microsoft\ Excel’

I am certain that it isn't a problem with running the .bashrc file because I have a print statement in it which works.

The error is: bash: alias: /Applications/Microsoft Office 2011/Microsoft Excel.app/Contents/MacOS/Microsoft Excel’: not found

Sorry if I'm missing something, but what could be the problem? Thank you.


Solution

  • You just have the wrong quote type:

    alias excel='/usr/bin/open /Applications/Microsoft\ Office\ 2011/Microsoft\ Excel.app/Contents/MacOS/Microsoft\ Excel'
    

    Works fine (tested on OS X Yosemite)