[实战运维小技巧]-解决perl命令执行或编译问题
解决perl命令执行或编译问题:执行如下命令时 报错:
# perl -pi -e 's|^passwd: files|passwd: files ldap|g' /etc/nsswitch.conf
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "zh_cn.gb18030"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
解答:
1.1.2解决perl命令执行或编译问题:
# echo 'export LC_ALL=C'>> /etc/profile
#←设置环境变量,解决后面perl程序插件的编译问题。符号“>>”表示向文件追加内容。
# tail -1 /etc/profile#←查看是否正确追加了export LC_ALL=C环境配置。
export LC_ALL=C
# source /etc/profile
#←使增加的环境变量配置生效。
页:
[1]