免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5799 | 回复: 5
打印 上一主题 下一主题

语言环境变量设置无法生效 (已解决) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-01-23 18:54 |只看该作者 |倒序浏览
用root帐号登陆以后画面是
Last login: Wed Jan 23 18:48:10 2008 from 192.168.0.92
Sun Microsystems Inc.   SunOS 5.9       Generic January 2003
You have new mail.
#

默认应该是没有使用shell吧
# locale
LANG=
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

我想改为zh_CN.GBK


根目录下原本没有.profile文件,我cp /etc/profile /.profile以后
在尾部加上了
export LANG=zh_CN.GBK
export LC_ALL=zh_CN.GBK
以后,重启过后
-sh: LANG=zh_CN.GBK: is not an identifier


请问要如何设置才能让这个语言环境变量永久生效。
万分感谢!!

[ 本帖最后由 alexyangw 于 2008-1-24 14:39 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-01-24 02:21 |只看该作者
是不是很语言相关的语言包没装?

论坛徽章:
0
3 [报告]
发表于 2008-01-24 08:37 |只看该作者
安装过了,每次在BASH shell中手动export LANG=zh_CN.GBK可以生效

论坛徽章:
0
4 [报告]
发表于 2008-01-24 09:50 |只看该作者
bash-2.05$ cd /etc/default
bash-2.05$ cat init
#ident  "@(#)init.dfl   1.6     00/05/27 SMI"
#
# This file is /etc/default/init.  /etc/TIMEZONE is a symlink to this file.
# This file looks like a shell script, but it is not.  To maintain
# compatibility with old versions of /etc/TIMEZONE, some shell constructs
# (i.e., export commands) are allowed in this file, but are ignored.
#
# Lines of this file should be of the form VAR=value, where VAR is one of
# TZ, LANG, CMASK, or any of the LC_* environment variables.
#
TZ=PRC
CMASK=022
LC_COLLATE=en_US.ISO8859-15
LC_CTYPE=C
LC_MESSAGES=C
LC_MONETARY=en_US.ISO8859-15
LC_NUMERIC=en_US.ISO8859-15
LC_TIME=en_US.ISO8859-15

论坛徽章:
0
5 [报告]
发表于 2008-01-24 10:32 |只看该作者
# cd /etc/default
# cat init
#ident  "@(#)init.dfl   1.6     00/05/27 SMI"
#
# This file is /etc/default/init.  /etc/TIMEZONE is a symlink to this file.
# This file looks like a shell script, but it is not.  To maintain
# compatibility with old versions of /etc/TIMEZONE, some shell constructs
# (i.e., export commands) are allowed in this file, but are ignored.
#
# Lines of this file should be of the form VAR=value, where VAR is one of
# TZ, LANG, CMASK, or any of the LC_* environment variables.
#
TZ=PRC
CMASK=022
LANG=zh_CN.GBK

这里原本设置的就是是zh_CN.GBK,不知道为什么还是没有生效。

论坛徽章:
0
6 [报告]
发表于 2008-01-24 14:38 |只看该作者
#状态下   (不知道是什么shell)
export LANG=zh_CN.GBK    是错误的
正确的写法是
LANG=zh_CN.GBK
export LANG

问题已解决
多谢大家的支持!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP