官术网_书友最值得收藏!

Switching the login shell to Bash

Even if it's not the shell that starts up when you log in, Bash may still be installed on your system, and you may still be able to change your login shell to it.

You might be able to start it by just typing bash:

$ bash

If you get output like command not found, you will probably need to install a Bash package specific to your system, or get your system administrator to do it for you. Consult your operating system's documentation to learn how to do this.

If you get a new prompt that looks like the Bash prompts in the previous section, you can then find the location of the bash program:

bash$ declare -p BASH
BASH="/usr/local/bin/bash"

Depending on the system, you might then be able to change Bash to your login shell to that path with the chsh tool:

$ chsh -s /usr/local/bin/bash

This might prompt you for your system password to allow you to make the change.

You may get an error message like this:

chsh: /usr/local/bin/bash is an invalid shell

In this case, the invalid shell part likely means that the path given needs to be added to the /etc/shells file, which specifies the programs the system and its administrator have allowed as login shells. You can inspect this list with cat:

$ cat /etc/shells

If you add your full path to bash on your system to that file, the chsh call should then succeed.

主站蜘蛛池模板: 宜章县| 赣州市| 辰溪县| 水城县| 迭部县| 南郑县| 双流县| 桦南县| 迁西县| 象州县| 黄冈市| 凤庆县| 江门市| 湾仔区| 姜堰市| 神木县| 台安县| 洞口县| 卢龙县| 肥乡县| 蕉岭县| 邛崃市| 巨鹿县| 光泽县| 新野县| 会东县| 遵义市| 阳春市| 无棣县| 光山县| 奉化市| 潞城市| 南汇区| 射阳县| 黔西| 郯城县| 鹤峰县| 莱西市| 喀喇沁旗| 溧水县| 大港区|