bash 未找到命令:完成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14409446/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
command not found: complete
提问by st0rk
I have a fresh mac in front of me, I installed homebrew (just fine), and oh my zsh (just fine).
我面前有一个新的 mac,我安装了自制软件(很好),哦,我的 zsh(很好)。
I'm trying to install autojump which is a intelligent database of directories. For example, you can 'jump' to ~/Documentswith j docin terminal.
我正在尝试安装 autojump,它是一个智能目录数据库。例如,你可以“跳”到~/Documents与j doc在终端。
I did this
我做了这个
brew install autojump
brew install autojump
I already have my .zshrc that looks fine I think. I added the line into it that it said:
我已经有了我认为看起来不错的 .zshrc。我在其中添加了以下内容:
[[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh
When I start iterm2 I get the following warning:
当我启动 iterm2 时,我收到以下警告:
/usr/local/Cellar/autojump/21.3.0/etc/autojump.bash:13: command not found: complete
/usr/local/Cellar/autojump/21.3.0/etc/autojump.bash:55: = not found
I have used brew to install other things, and I can run autojump -ssuccessfully so I know it is seeing the $path. I don't know what else could be wrong though, as this is all a fresh install.
我已经使用 brew 安装了其他东西,我可以autojump -s成功运行,所以我知道它正在看到$path. 不过我不知道还有什么问题,因为这都是全新安装。
回答by ebrehault
In your .zshrc, you must source autojump.zsh, not autojump.bash(I do not know where it will be located on a Mac, but it will be in same folder as autojump.bash).
在您的 .zshrc 中,您必须提供autojump.zsh,而不是autojump.bash(我不知道它在 Mac 上的位置,但它将与 autojump.bash 位于同一文件夹中)。
On Ubuntu, here is what you need to append at the end of your .zshrc:
在 Ubuntu 上,以下是您需要在 .zshrc 末尾附加的内容:
source /usr/share/autojump/autojump.zsh
回答by Amelio Vazquez-Reina
To fix the problem, you should update the line:
要解决此问题,您应该更新该行:
[[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh
to say:
说:
[[ -s `brew --prefix`/etc/autojump.zsh ]] && . `brew --prefix`/etc/autojump.zsh
i.e. use the .zshversion of the autojump script. That fixed it for me.
即使用.zsh版本的 autojump 脚本。那为我修好了。
回答by Steven Penny
That filehas no Shebang. This means that it is probably getting interpreted by Zsh.
该文件没有 Shebang。这意味着它可能会被 Zsh 解释。
This is a problem because completeis a Bash builtin.
这是一个问题,因为complete是Bash 内置的。
Perhaps thiscan be a fix for you, or maybe
也许这可以为您解决问题,或者
[[ -s `brew --prefix`/etc/autojump.sh ]] && bash `brew --prefix`/etc/autojump.sh
回答by Benjamin Frazier
You need to add
你需要添加
[[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh
to your ~/.bash_profile. Homebrew tells you this when you install but I didn't notice it the first time and came to this webpage as a result.
到您的~/.bash_profile. Homebrew 在您安装时会告诉您这一点,但我第一次没有注意到,结果来到了这个网页。

