MacOS卸载zsh后无法执行二进制文件

MacOS卸载zsh后无法执行二进制文件

打开终端后,将出现以下文本:

Last login: Mon Mar 26 17:51:02 on ttys001
-bash: /usr/local/bin/dirname: cannot execute binary file
-bash: /usr/local/bin/dirname: cannot execute binary file
-bash: /usr/local/bin/tr: cannot execute binary file
-bash: /usr/local/bin/dirname: cannot execute binary file
-bash: /usr/local/bin/dirname: cannot execute binary file
Marek:~ marek$

卸载 zsh shell 后会发生这种情况。我该如何修复?

答案1

我不是 MacOS X 专家,但我知道它是 BSD。我知道在 FreeBSD 上安装软件包需要我先运行,rehash然后它才能找到没有明确路径的新可执行文件。看起来在 bash 中是hash -r这样的,所以也许可以试一试(参见:如何使用 bash 重新哈希 $PATH 中的可执行文件

相关内容