简体   繁体   English

.bash_profile别名:找不到命令

[英].bash_profile aliases: command not found

I cannot get my .bash_profile aliases to work on my Mac OSX Terminal. 我无法让我的.bash_profile别名在我的Mac OSX终端上运行。 I created a .bash_profile file in my ~/ directory, then wrote two lines: 我在〜/目录中创建了一个.bash_profile文件,然后写了两行:

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. 我知道配置文件是源代码,因为它显示了echo,但是无论在别名中保存什么命令,终端都会显示相同的“未找到”消息。 Does anybody know what else I can try? 有谁知道我还能尝试什么?

Let's ask shellcheck! 我们问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. OS X已将您的双引号转换为bash无法识别的花哨的倾斜引号。 If you're programming, you may want to disable "smart quotes" . 如果您正在编程,则可能需要禁用“智能引号”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM