免费注册 查看新帖 |

Chinaunix

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

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

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-01-23 18:54 |只看该作者 |倒序浏览
用root帐号登陆以后画面是\r\nLast login: Wed Jan 23 18:48:10 2008 from 192.168.0.92\r\nSun Microsystems Inc.   SunOS 5.9       Generic January 2003\r\nYou have new mail.\r\n#\r\n\r\n默认应该是没有使用shell吧\r\n# locale\r\nLANG=\r\nLC_CTYPE=\"C\"\r\nLC_NUMERIC=\"C\"\r\nLC_TIME=\"C\"\r\nLC_COLLATE=\"C\"\r\nLC_MONETARY=\"C\"\r\nLC_MESSAGES=\"C\"\r\nLC_ALL=\r\n\r\n我想改为zh_CN.GBK\r\n\r\n\r\n根目录下原本没有.profile文件,我cp /etc/profile /.profile以后\r\n在尾部加上了\r\nexport LANG=zh_CN.GBK\r\nexport LC_ALL=zh_CN.GBK\r\n以后,重启过后\r\n-sh: LANG=zh_CN.GBK: is not an identifier\r\n\r\n\r\n请问要如何设置才能让这个语言环境变量永久生效。\r\n万分感谢!!\n\n[ 本帖最后由 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\r\nbash-2.05$ cat init\r\n#ident  \"@(#)init.dfl   1.6     00/05/27 SMI\"\r\n#\r\n# This file is /etc/default/init.  /etc/TIMEZONE is a symlink to this file.\r\n# This file looks like a shell script, but it is not.  To maintain\r\n# compatibility with old versions of /etc/TIMEZONE, some shell constructs\r\n# (i.e., export commands) are allowed in this file, but are ignored.\r\n#\r\n# Lines of this file should be of the form VAR=value, where VAR is one of\r\n# TZ, LANG, CMASK, or any of the LC_* environment variables.\r\n#\r\nTZ=PRC\r\nCMASK=022\r\nLC_COLLATE=en_US.ISO8859-15\r\nLC_CTYPE=C\r\nLC_MESSAGES=C\r\nLC_MONETARY=en_US.ISO8859-15\r\nLC_NUMERIC=en_US.ISO8859-15\r\nLC_TIME=en_US.ISO8859-15

论坛徽章:
0
5 [报告]
发表于 2008-01-24 10:32 |只看该作者
# cd /etc/default\r\n# cat init\r\n#ident  \"@(#)init.dfl   1.6     00/05/27 SMI\"\r\n#\r\n# This file is /etc/default/init.  /etc/TIMEZONE is a symlink to this file.\r\n# This file looks like a shell script, but it is not.  To maintain\r\n# compatibility with old versions of /etc/TIMEZONE, some shell constructs\r\n# (i.e., export commands) are allowed in this file, but are ignored.\r\n#\r\n# Lines of this file should be of the form VAR=value, where VAR is one of\r\n# TZ, LANG, CMASK, or any of the LC_* environment variables.\r\n#\r\nTZ=PRC\r\nCMASK=022\r\nLANG=zh_CN.GBK\r\n\r\n这里原本设置的就是是zh_CN.GBK,不知道为什么还是没有生效。

论坛徽章:
0
6 [报告]
发表于 2008-01-24 14:38 |只看该作者
#状态下   (不知道是什么shell)\r\nexport LANG=zh_CN.GBK    是错误的\r\n正确的写法是\r\nLANG=zh_CN.GBK\r\nexport LANG\r\n\r\n问题已解决\r\n多谢大家的支持!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP