AIX 5.3系统,用shell执行下面这个命令的时候报Warning:
perl -e "print sprintf '%04d%02d%02d%02d%02d%02d',(localtime(time()-3600))[5]+1900,(localtime(time()-3600))[4]+1,(localtime(time()-3600))[3],(localtime(time()-3600))[2],(localtime(time()-3600))[1],(localtime(time()-3600))[0]"
提示:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LC__FASTMSG = "true",
LANG = "zh_CN.hp15CN"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
搜了一下解决方法,最简单的就是设置一下LC_ALL变量,方法如下:
TEMP_LCALL=$LC_ALL
export LC_ALL=C
blablabla
export LC_ALL=$TEMP_LCALL
或者,你可以选择完全无视这些个Warning。。
关于LC_ALL等变量的介绍参看这篇:【转】locale的设定及其LANG、LC_ALL、LANGUAGE环境变量的区别