-bash: 打开: 命令未找到
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27110648/
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
-bash: open: command not found
提问by nlw13
I was working on amending my ANDROID_HOME
and PATH
to begin working with Cordova for mobile application development. I was having trouble with export $PATH
returning a not a valid identifier
error. I changed a $PATH
reference in a line in the .bash_profile
to PATH
on recommendation and now I'm entirely unable to open .bash_profile
. I am using Mac OS X Yosemite. I receive the following error:
我正在修改我的ANDROID_HOME
并PATH
开始使用 Cordova 进行移动应用程序开发。我在export $PATH
返回not a valid identifier
错误时遇到了麻烦。我改变了$PATH
在一个基准线.bash_profile
到PATH
上建议,现在我完全无法open .bash_profile
。我正在使用 Mac OS X 优胜美地。我收到以下错误:
-bash: open: command not found
-bash: open: command not found
From research, it's likely a typo in the .bash_profile
but I'm unaware of how I can rectify this without being able to open the .bash_profile itself, can anybody help? Also when attempting to call Cordova e.g. cordova add platform android
I receive -bash: cordova: command not found
after it previously functioned correctly?
从研究来看,这可能是一个错字,.bash_profile
但我不知道如何在无法打开 .bash_profile 本身的情况下纠正这个问题,有人可以帮忙吗?此外,当cordova add platform android
我尝试调用 Cordova 时,例如我-bash: cordova: command not found
在它之前正常运行后收到?
My .bash_profile
included
export ANDROID_HOME=/Development/android-sdk-macosx export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
我的.bash_profile
包括
export ANDROID_HOME=/Development/android-sdk-macosx export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
I believe I mistakenly removed $ from the 2nd line, leaving PATH={PATH}.
我相信我错误地从第二行中删除了 $,离开 PATH={PATH}.
As I am using Mac OS X all dot files are hidden, when attempting to show . files I receive the error -bash: defaults: command not found
.
由于我使用的是 Mac OS X,因此在尝试显示 . 文件我收到错误-bash: defaults: command not found
。
Thanks
谢谢
回答by l0b0
export $PATH
doesn't do what you expect - variable substitution happens beforecommand execution in Bash. You need to export PATH
. And to debug the contents of any dot files you need to include their contents in the question.
export $PATH
不符合您的预期 - 变量替换发生在 Bash 中的命令执行之前。你需要export PATH
。并且要调试任何点文件的内容,您需要在问题中包含它们的内容。
回答by Etan Reisner
Having destroyed your PATH
environment variable your shell can no longer find any binaries. You can either give a full path to whatever application you want to run to edit your .bash_profile
file or just open it from your chosen editor using the gui file selector.
破坏了您的PATH
环境变量后,您的 shell 无法再找到任何二进制文件。您可以提供要运行以编辑.bash_profile
文件的任何应用程序的完整路径,也可以使用 gui 文件选择器从您选择的编辑器中打开它。