Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2231733
  • 博文数量: 533
  • 博客积分: 8689
  • 博客等级: 中将
  • 技术积分: 7046
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-26 10:00
文章分类

全部博文(533)

文章存档

2024年(2)

2023年(4)

2022年(16)

2014年(90)

2013年(76)

2012年(125)

2011年(184)

2010年(37)

分类: LINUX

2011-09-14 17:51:44



 #!/bin/bash

IPADDRS=`/sbin/ifconfig | grep -P -o "((eth[\w:]+)|(addr:[\d.]+)|(lo[\d:]*))" | perl -e '%face;foreach (){$int=$1 if (/((?:(
?:eth)|(?:lo))[\d:]*)/);$face{$int}=$1 if (/addr:([\d.]+)/);};foreach $interf (sort keys %face){print "$interf = $face{$interf}\t" 
if ($interf !~ /^lo$/)}'`

if [ $UID -eq 0 ]
then
        PS1="\n\n\033[1;34m[\u@\H]\e[m  \033[1;33m$IPADDRS\e[m \n[\t] PWD => \033[1;35m\w\e[m\n\#># "
else
        PS1="\n\n\033[1;34m[\u@\H]\e[m  \033[1;33m$IPADDRS\e[m \n[\t] PWD => \033[1;35m\w\e[m\n\#>\$ "
fi


 chmod  +x   /etc/profile.d/shopex_tty.sh
/etc/profile.d/shopex_tty.sh
echo "/etc/profile.d/shopex_tty.sh" >> /etc/rc.d/rc.local



阅读(675) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~