che*_*kha 9 osx shell bash homebrew
我正在尝试更新bash
Mac OS Mavericks 上的 shell。
$ brew install bash
$ which -a bash
/bin/bash
/usr/local/bin/bash
$ which bash
/bin/bash
$ chsh -s /usr/local/bin/bash
$ which bash
/bin/bash
Run Code Online (Sandbox Code Playgroud)
在终端的首选项中:Shells open with -> Command (complete path) : /usr/local/bin/bash
。
但是,我仍然无法切换到 brew 安装的 bash shell。我能做什么?
Ant*_*Ant 21
从chsh
手册:
当更改登录 shell 而不是超级用户时,用户不能从非标准 shell 更改为非标准 shell。非标准被定义为在
/etc/shells
.
所以你可以chsh
以root身份运行
sudo chsh -s /usr/local/bin/bash "$USER"
Run Code Online (Sandbox Code Playgroud)
或添加/usr/local/bin/bash
以/etc/shells
使其成为“标准外壳”
echo /usr/local/bin/bash | sudo tee -a /etc/shells
chsh -s /usr/local/bin/bash
Run Code Online (Sandbox Code Playgroud)
需要注意的是,事实which bash
仍然指向/bin/bash
并不意味着你的shell还没有改变,它只是意味着/bin
是之前/usr/local/bin
在你的$PATH
。
归档时间: |
|
查看次数: |
5583 次 |
最近记录: |