Matt LaRose
Matt LaRose

Reputation: 133

.bash_profile aliases: command not found

I cannot get my .bash_profile aliases to work on my Mac OSX Terminal. I created a .bash_profile file in my ~/ directory, then wrote two lines:

echo bash profile has loaded

alias prof=“open ~/.bash_profile”

I saved and entered in Terminal command:

. ~/.bash_profile

Terminal displayed:

bash profile has loaded

-bash: alias: /Users/kennethlarose/.bash_profile”: not found

I've been reading up on alias profiles, and I believe my syntax is valid. I know the profile is sourcing because it displays the echo, but Terminal will show the same 'not found' message no matter what command I save in the alias. Does anybody know what else I can try?

Upvotes: 13

Views: 19262

Answers (1)

that other guy
that other guy

Reputation: 123690

Let's ask shellcheck!

In .bash_profile line 2:
alias prof=“open ~/.bash_profile”
           ^-- SC1015: This is a unicode double quote. Delete and retype it.

There's your problem. OS X has turned your double quotes into fancy slanted quotes that bash doesn't recognize. If you're programming, you may want to disable "smart quotes".

Upvotes: 32

Related Questions