I'm trying to add some aliases to my bash profile, but it's not working for some reason and I get these errors when I open a new terminal or execute bash profile with . ~/.bash_profile.

These are the errors I get:

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

-bash: alias: package: not found

This is what I have in my bashprofile:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home

"#" Aliases

alias edit=“open ~/.bash_profile”

alias pack=“mvn package && clear”

The problem is that you're using fancy quotes () rather than regular quotes ("). This causes ~/.bash_profile” and package to appear as distinct arguments to alias instead of the right-hand side being taken as a single string. alias then starts looking for aliases with those names.

Correct the quotes and you should be all set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.