概述
刚准备在FreeBSD下学习Shell,结果发现怎么好多命令都没有,比如declare。后来发现连bash都没有,好像bash用的多一些吧,于是就准备将csh换成bash。
由于没有bash,所以先得安装一个bash:
pkg install bash -- 下载速度超慢,不过好在bash不大
root@www:/usr/ports/ports-mgmt/pkg # pkg install bash
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):
New packages to be INSTALLED:
bash: 4.4.12_1
Number of packages to be installed: 1
The process will require 8 MiB more space.
1 MiB to be downloaded.
Proceed with this action? [y/N]: y
[1/1] bash-4.4.12_1.txz : 100% 1 MiB 36.5kB/s 00:40
Checking integrity... done (0 conflicting)
[1/1] Installing bash-4.4.12_1...
Extracting bash-4.4.12_1: 100%
Message from bash-4.4.12_1:
======================================================================
bash requires fdescfs(5) mounted on /dev/fd
If you have not done it yet, please do the following:
mount -t fdescfs fdescfs /dev/fd
To make it permanent, you need the following lines in /etc/fstab:
fdescfs /dev/fd fdescfs rw,late 0 0
======================================================================
安装好了bash之后,用如下命令更换shell:
chsh -s /usr/local/bin/bash
root@www:/usr/ports/ports-mgmt/pkg # chsh -s /usr/local/bin/bash
chsh: user information updated
然后查看当前SHELL:
[root@www ~]# echo $SHELL
/usr/local/bin/bash
更换非root用户默认的shell,#chsh -s /usr/local/bin/bash username -- 用实际的用户名替换
p.s.
freebsd安装了bash之后并不默认去读取.bashrc文件,如果想做设置类似
alias ls='ls - G',那么应该直接添加到.profile里面然后:
source .profile就可以了
p.s.
为了支持中文显示,可以在.profile中添加如下内容:
export LANG=zh_CN.UTF-8
export LC_CTYPE=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
转载于:https://www.cnblogs.com/tuhooo/p/6566207.html
最后
以上就是坚强向日葵为你收集整理的FreeBSD将SHELL从csh换成bash并支持中文显示的全部内容,希望文章能够帮你解决FreeBSD将SHELL从csh换成bash并支持中文显示所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复