标签: .bash-profile

如何从命令行重新加载.bash_profile?

如何.bash_profile从命令行重新加载?我可以让shell .bash_profile通过退出并重新登录来识别更改,但我希望能够按需执行此操作.

bash shell .bash-profile

920
推荐指数
9
解决办法
70万
查看次数

在bash shell脚本中重新加载.profile(在unix中)?

我是bash shell脚本的新手,遇到了挑战.我知道我可以通过以下方式重新加载我的".profile"文件:

. .profile
Run Code Online (Sandbox Code Playgroud)

但我正在尝试在我正在编写的bash脚本中执行相同的操作,但它只是无法正常工作.有任何想法吗?还有什么我可以澄清的吗?

谢谢

unix bash shell .bash-profile

119
推荐指数
3
解决办法
16万
查看次数

在bash中将参数传递给别名

是否可以执行以下操作:

我想运行以下内容:

mongodb bin/mongod
Run Code Online (Sandbox Code Playgroud)

在我的bash_profile中我有

alias = "./path/to/mongodb/$1"
Run Code Online (Sandbox Code Playgroud)

bash shell .bash-profile

118
推荐指数
5
解决办法
9万
查看次数

在执行rvm使用2.0.0 --default时出现"警告!PATH未正确设置"

以上不是第一次工作,第二次工作.

尝试将ruby版本设置为2.0.0以用于任何新的shell窗口.

$ rvm use 2.0.0 --default
Run Code Online (Sandbox Code Playgroud)

Warning! PATH is not properly set up, '/home/durrantm/.rvm/gems/ruby-1.9.3-p125/
bin' is not at first place,
         usually this is caused by shell initialization files - check them for '
PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --au
to-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p125'
.
Using /home/durrantm/.rvm/gems/ruby-2.0.0-p247
Run Code Online (Sandbox Code Playgroud)

然后做同样的事情

$ rvm use 2.0.0 --default
Run Code Online (Sandbox Code Playgroud)

现在没有错误,即

$ rvm use 2.0.0 --default
Using …
Run Code Online (Sandbox Code Playgroud)

ruby bash .bash-profile rvm ruby-2.0

103
推荐指数
8
解决办法
6万
查看次数

Snow Leopard上的.profile和.bash_profile之间的区别

我将在我的计算机上设置mySQl的路径(我正在运行Snow Leopard)但我在网上看到了不同的说明.

有人说要更改.profile文件,有人说更改.bash_profile文件.有什么不同?

macos terminal .bash-profile

64
推荐指数
2
解决办法
3万
查看次数

如何从mac上的$ PATH中删除条目

我试图安装Sencha Touch SDK工具2.0.0但无法正常运行.它在$ PATH变量中创建了一个条目.后来我删除了sencha sdk tools文件夹,但没有意识到路径变量仍然存在.

我什么时候echo $PATH得到 -

/Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

我搜索了如何从$ PATH中删除变量并执行以下步骤:

  1. 发出命令 PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
  2. 难道echo $PATH这表明/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
  3. 发出命令 export PATH
  4. 关闭终端并重新打开它.发出命令echo $PATH.这次我得到了 /Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

谁能告诉我我做错了什么?

macos bash terminal path-variables .bash-profile

62
推荐指数
6
解决办法
8万
查看次数

sudo:port:找不到命令

我最近卸载了Xcode 4.2并重新安装了Xcode 4.3.1.命令行工具已安装.然后,我使用macports.org中的Lion"dmg"磁盘映像安装了MacPort.因为,我sudo: port: command not found在每次使用端口之后都得到了,我按照这个这个帖子来创建一个.bash_profile文件(之前没有出现),然后输入以下内容但无济于事.

export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info 
Run Code Online (Sandbox Code Playgroud)

关注这篇文章

?  ~ git:(master) ? rvm install 1.8.7 --with-openssl-dir=/opt/local
You requested building with '/usr/bin/gcc-4.2' but it is not in your path.
?  ~ git:(master) ? vi .rvmrc 

rvm_archflags="-arch x86_64"

export CC="/usr/bin/gcc-4.2"

export CFLAGS="-O2 -arch x86_64"
export LDFLAGS="-L/opt/local/lib"
export CPPFLAGS="-I/opt/local/include"
Run Code Online (Sandbox Code Playgroud)

重命名.bash_profile.profile

?  ~ git:(master) ? vi .bash_profile
?  ~ git:(master) ? mv .bash_profile .profile
?  ~ …
Run Code Online (Sandbox Code Playgroud)

terminal macports .bash-profile osx-lion xcode4.3

60
推荐指数
7
解决办法
13万
查看次数

.bash_profile sed:\ 1未在RE中定义

我将在OS X 10.9上设置本地Web开发环境并安装Homebrew.我的指南中的下一步告诉我~/.bash_profile使用以下命令向我添加逻辑:

echo "export PATH=\$(echo \$PATH | sed 's|/usr/local/bin||; s|/usr/local/sbin||; s|::|:|; s|^:||; s|(.*)|/usr/local/bin:/usr/local/sbin:\1|')" >> ~/.bash_profile && source ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)

当我在终端输入时,我得到:

sed: 1: "s|/usr/local/bin||; s|/ ...": \1 not defined in the RE
Run Code Online (Sandbox Code Playgroud)

export PATH=/usr/local/bin:/usr/local/sbin:$PATH应该写给我的.bash_profile吗?为什么我会收到这个错误?

homebrew sed .bash-profile

42
推荐指数
1
解决办法
2万
查看次数

如何让GNU屏幕读取.bash_profile/.bash_rc更改?

在我进行更改后,.bash_rc或者.bash_profile当我启动GNU屏幕时,它无法识别这些更改.我可以

source ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)

它适用于我打开的当前屏幕窗口,但我必须为我打开的每个屏幕窗口执行此操作.

如何获取屏幕以读取我的bash配置中的最新更改?

unix linux bash gnu-screen .bash-profile

40
推荐指数
2
解决办法
1万
查看次数

尽管Anaconda安装,Mac仍使用默认Python

我正在运行Mac 10.9 Mavericks并安装了Anaconda.然而,尽管如此,当我通过终端访问python时,我仍然获得默认的Apple版本:

Python 2.7.5 (default, Sep  2 2013, 05:24:04) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Run Code Online (Sandbox Code Playgroud)

我的.bash_profile是这样的:

export PATH="$HOME/anaconda/bin:$PATH"

MONGO_PATH=/usr/local/mongodb/bin
SQL_PATH=/usr/local/mysql

export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH"
Run Code Online (Sandbox Code Playgroud)

有什么办法可以使用Anaconda版本的Python吗?此刻不知所措.

谢谢

python macos .bash-profile anaconda conda

35
推荐指数
2
解决办法
5万
查看次数