.bash_profile中别名:命令未找到 [英] .bash_profile aliases: command not found
问题描述
我不能让我的.bash_profile别名,在我的Mac OS X的终端工作。我在〜/目录下创建一个文件的.bash_profile,然后写了两行:
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
显示终端:
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?
推荐答案
让我们问shellcheck!
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.
有是你的问题。 OS X已经把你的双引号到看中的倾斜引号的bash中无法识别。如果你编程,你可能要禁用智能引号。
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".
这篇关于.bash_profile中别名:命令未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!