帮助恢复回它原来的

帮助恢复回它原来的

本文介绍了.bash_profile中损坏的找不到,找不到命令...帮助恢复回它原来的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用我的Mac上安装蒙戈DB玩......和导出MongoDB的/ bin目录到PATH ..貌似我损坏的.bash_profile,现在我找不到它。

这是我做过什么:

 纳米〜/ .bash_profile中

该文件不存在,所以我继续创造了一个并添加以下行

 出口PATH = {$ PATH}:〜/蒙戈/箱

所以现在我保存的文件..由pressing Ctrl + O键,然后按下回车键的提示。然后我pressed CTRL + X退出纳米。我重装用以下命令我的bash配置文件:

  $源〜/ .bash_profile中。

......

现在甚至像开放,透明,grep的等基本命令将导致

-bash:明确:命令未找到

当我这样做

 出口$ PATH

这是显示的内容...

*

*

I am a novice in this.. Please help me get back to my original state where I had access to all the mac and unix commands..

Let me know if you require additional details.. My OS is mountain lion.. I had also XCode installed..

解决方案

I suspect the issue is that $PATH is being expanded when you don't want it to be. The export command isn't treated any differently. Export expects the name of an environment variable to export, but you aren't giving it the name of the variable, you are giving it the variable reference itself, which gets expanded.

Think about this:

echo PATH

outputs

PATH

However, this

echo $PATH

outputs this:

{{/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin}:/Users/pavbond007/Documents/Mongo/mongodb-osx-x86_64-2.2.3/bin}:/Users/pavbond007/Documents/Mongo/mongodb-osx-x86_64-2.2.3/bin

Therefore, to export the PATH variable, try this instead (notice the lack of dollar sign):

export PATH

Also, I noticed your $PATH has a bunch of curly braces in it. Take those out. I'm pretty sure that is breaking things.

To do this in one line like you tried first, let's bring it all together:

export PATH=$PATH:~/mongo/bin

这篇关于.bash_profile中损坏的找不到,找不到命令...帮助恢复回它原来的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 06:27