Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3162150
  • 博文数量: 443
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 5678
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-08 12:30
个人简介

欢迎加入IT云增值在线QQ交流群:342584734

文章分类

全部博文(443)

文章存档

2022年(1)

2021年(1)

2015年(2)

2014年(1)

2013年(1)

2012年(4)

2011年(19)

2010年(32)

2009年(2)

2008年(4)

2007年(31)

2006年(301)

2005年(42)

2004年(2)

分类:

2006-03-19 16:58:15

Q: 一台SPARC/Solaris 8运行在US locale环境中,现在我们想让它运行在IE(Ireland) locale环境中,以便可以使用欧洲日期格式,怎么办?
A1: 运行sys-unconfig,在此之前请man -s 1M sys-unconfig,:-)
A2: 天啊,为了拍死一只苍蝇,你要引爆原子弹吗?
只需要做如下操作,在你的.cshrc/.profile/.bashrc等启动脚本中设置$LANG环境变量的值为en_UK,注销,重新登录即可。为了使这个设置全局有效,修改/etc/default/init文件,LANG=en_UK,重启动。
--------------------------------------------------------------------------
# @(#)init.dfl 1.2 92/11/26
#
# 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, or any of the LC_* environment variables.
#
TZ=GMT+8
LANG=zh.GBK
--------------------------------------------------------------------------
参看locale(1)和locale(5),了解更多关于locale的信息。运行"locale -a",查看当前系统所支持的所有locale。
 
有三种方式改变locale。首先用"locale -a"命令确认系统中已安装的locale
1) 从CDE登录屏幕上修改locale
选择 options -> languages -> choose the new locale
注意,如果登录用户的初始化文件中有不同的locale设置,将优先于系统全局locale设置。
2) 临时设置locale(shell相关的)
ksh : LANG=
sh  : LANG=
      export LANG
csh : setenv LANG
bash: export LANG=en_US(zh.GBK)
3) vi /etc/default/init
增加如下内容
LANG=
LC_ALL=
重启系统。
运行"locale"命令确认改变生效。
如果你希望使用的locale并未安装,参看如下文档安装locale
Solaris 8  : <>
Solaris 7  : <>
Solaris 2.6: <>
 
SPARC/Solaris 2.5下,为了在vi中正确看到中文需要设置环境变量
sh
LANG=C;export LANG
LC_CTYPE=iso_8859_1;export LC_CTYPE
csh
setenv LANG zh
关于设置LANG这个环境变量涉及到/usr/lib/locale下的目录权限。
阅读(1472) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~