.bash_profile aliases: command not found

笑着哭i 提交于 2019-12-04 00:22:37

问题


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?


回答1:


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".



来源:https://stackoverflow.com/questions/25319631/bash-profile-aliases-command-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!