设置Linux环境的欢迎登陆信息
1、编辑/etc/profile文件添加如下内容:
for i in /etc/profile.d/*.sh ; do if [ -r "$i" ]; then if [ "${-#*i}" != "$-" ]; then . "$i" else . "$i" >/dev/null 2>&1 fi fi done
2、在/etc/profile.d放置相关脚本
[root@typhoeus79 ice_test_m profile.d]# ll 总计 140 -rwxr-xr-x 1 root root 764 2009-09-04 colorls.csh -rwxr-xr-x 1 root root 725 2009-09-04 colorls.sh -rwxr-xr-x 1 root root 78 2009-09-04 cvs.sh -rwxr-xr-x 1 root root 192 2009-03-25 glib2.csh -rwxr-xr-x 1 root root 192 2009-03-25 glib2.sh -rw-r--r-- 1 root root 125 2012-03-01 java.sh -rw-r--r-- 1 root root 218 2004-09-09 krb5-devel.csh -rw-r--r-- 1 root root 229 2006-01-20 krb5-devel.sh -rw-r--r-- 1 root root 218 2004-09-09 krb5-workstation.csh -rw-r--r-- 1 root root 229 2006-01-20 krb5-workstation.sh -rwxr-xr-x 1 root root 2959 2009-09-29 lang.csh -rwxr-xr-x 1 root root 3234 2009-09-29 lang.sh -rwxr-xr-x 1 root root 122 2009-09-27 less.csh -rwxr-xr-x 1 root root 108 2009-09-27 less.sh -rwxr-xr-x 1 root root 38 12-23 12:52 motd.sh -rwxr-xr-x 1 root root 97 2009-09-20 vim.csh -rwxr-xr-x 1 root root 293 2009-09-20 vim.sh -rwxr-xr-x 1 root root 170 2007-01-07 which-2.sh -rwxr-xr-x 1 root root 18 12-24 14:20 yum_var.sh
3、简单的文本信息设置
http://www.blogjava.net/baizhihui19870626/articles/372694.html
The Bash Shell Startup Files
http://www.linuxfromscratch.org/blfs/view/svn/postlfs/profile.html
鸟哥私房菜的介绍
http://linux.vbird.org/linux_basic/0320bash.php#settings_issue