我无法让我的.bash_profile别名在我的Mac终端上工作。我在~/目录中创建了一个.bash_profile文件,然后写了两行:
echo bash profile has loaded
alias prof=“open ~/.bash_profile”我在终端命令中保存并输入:
. ~/.bash_profile显示的终端:
bash profile has loaded
-bash: alias: /Users/kennethlarose/.bash_profile”: not found我一直在研究别名配置文件,我相信我的语法是有效的。我知道配置文件正在采购,因为它显示了回声,但是无论我在别名中保存什么命令,终端都会显示相同的'not found‘消息。有没有人知道我还可以尝试什么?
发布于 2014-08-15 09:24:39
让我们来问一下shellcheck!
In .bash_profile line 2:
alias prof=“open ~/.bash_profile”
^-- SC1015: This is a unicode double quote. Delete and retype it.这就是你的问题所在。OS已经把你的双引号变成了bash无法识别的花哨的斜引号。如果你正在编程,你可能想要disable "smart quotes"。
https://stackoverflow.com/questions/25319631
复制相似问题