Linux Bash Shell系統(tǒng)的應(yīng)用詳解
給大家推薦一款很不錯(cuò)的Linux Bash Shell系統(tǒng)很有學(xué)習(xí)價(jià)值,這里我主要講解Linux shell系統(tǒng)的應(yīng)用,包括介紹Linux shell知識(shí)等方面。
一、在Linux Bash Shell下,執(zhí)行export:
declare -x LANG="en_US"這個(gè)LANE環(huán)境變量,就是我們希望去修改的,但是在哪里修改,比較合適呢?
二、Linux Bash Shell使用man bash:
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.
即bash在登錄時(shí),會(huì)依次讀取這些配置文件:
- /etc/profile
- /.bash_profile
- /.bash_login
- /.profile
三、對(duì)于Linux Bash Shell的默認(rèn)語(yǔ)言
應(yīng)該在系統(tǒng)級(jí)的文件中(/etc/profile)修改,以便修改的結(jié)果可以被每一個(gè)用戶繼承:打開/etc/profile,直接在其上,找不到關(guān)于LANG變量的設(shè)置命令,但細(xì)心觀察,該腳本還執(zhí)行了其他腳本:for i in /etc/profile.d/*.sh ; doif [ -r "$i" ]; then . $i fi done
四、到/etc/profile.d/目錄下,查看這些*.sh的腳本,發(fā)現(xiàn)了一個(gè)名為"lang.sh"的文件,應(yīng)該就是它了:
打開/etc/profile.d/lang.sh,開頭幾句:for langfile in /etc/sysconfig/i18n $HOME/.i18n ; do[ -f $langfile ] && . $langfile && sourced=1done這個(gè)/etc/sysconfig/i18n,就是設(shè)置系統(tǒng)默認(rèn)語(yǔ)言的地方,對(duì)于我的系統(tǒng),現(xiàn)在它的內(nèi)容如下:
- LANG="en_US"
- SUPPORTED="en_US:en"
- SYSFONT="lat0-sun16"
- SYSFONTACM="iso01"
如果,你希望系統(tǒng)的默認(rèn)語(yǔ)言變更為UTF-8,可以把LANG修改為:LANG="en_US.UTF-8"
【編輯推薦】
- 深度淺析種類模式Linux shell編程
- 暢談簡(jiǎn)介L(zhǎng)inux shell內(nèi)核傳遞命令
- 完全講解終級(jí)Linux shell命令模式
- 全面分析討論Linux Shell編程
- 簡(jiǎn)要介紹Linux shell命令的收集編程語(yǔ)言





















