免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 1714 | 回复: 12
打印 上一主题 下一主题

/etc/profile的疑问? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-11-28 22:06 |只看该作者 |倒序浏览
tHIS is /etc/profile content for solaris9 X86
看看红色的是什么意思?谢谢

#ident        "@(#)profile        1.19        01/03/13 SMI"        /* SVr4.0 1.3        */

# The profile that all logins get before using their own .profile.

trap ""  2 3
export LOGNAME PATH

if [ "$TERM" = "" ]
then
        if /bin/i386
        then
                TERM=sun-color
        else
                TERM=sun
        fi
        export TERM
fi

#        Login and -su shells get /etc/profile services.
#        -rsh is given its environment in its .profile.

case "$0" in
-sh | -ksh | -jsh | -bash)

        if [ ! -f .hushlogin ]
        then
                /usr/sbin/quota
                #        Allow the user to break the Message-Of-The-Day only.
                trap "trap '' 2"  2
                /bin/cat -s /etc/motd
                trap "" 2

                /bin/mail -E
                case $? in
                0)
                        echo "You have new mail."
                          ;;
                2)
                        echo "You have mail."
                           ;;
                esac
        fi
esac

umask 022
trap  2 3

论坛徽章:
0
2 [报告]
发表于 2004-11-29 09:35 |只看该作者

/etc/profile的疑问?

哪个红色?

论坛徽章:
0
3 [报告]
发表于 2004-11-29 19:54 |只看该作者

/etc/profile的疑问?

trap "trap '' 2" 2
/bin/cat -s /etc/motd

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
4 [报告]
发表于 2004-11-29 22:06 |只看该作者

/etc/profile的疑问?

trap "trap '' 2" 2
#当shell接受到信号2(一般情况下是ctrl+C)时,执行trap '' 2,即忽略ctrl+C所产生的中断
/bin/cat -s /etc/motd
#显示/etc/motd的内容,motd文件存放的是当天的一些讯息
关于trap,他的作用是当shell接受到某一个信号,就执行特定的操作!信号列表,可以用:
kill -l来获得

论坛徽章:
0
5 [报告]
发表于 2004-11-29 22:11 |只看该作者

/etc/profile的疑问?

原帖由 "寂寞烈火" 发表:
trap "trap '' 2" 2
#当shell接受到信号2(一般情况下是ctrl+C)时,执行trap '' 2,即忽略ctrl+C所产生的中断



trap "trap '' 2" 2   等于 trap '' 2  

Right ??

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
6 [报告]
发表于 2004-11-29 22:38 |只看该作者

/etc/profile的疑问?

看一下你系统的shell的manual,里面有trap的解释!

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
7 [报告]
发表于 2004-12-05 17:49 |只看该作者

/etc/profile的疑问?

借问一下:我怎么找不到这些内容呢

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
8 [报告]
发表于 2004-12-05 17:58 |只看该作者

/etc/profile的疑问?

[quote]原帖由 "wingger"]借问一下:我怎么找不到这些内容呢[/quote 发表:

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
9 [报告]
发表于 2004-12-05 18:00 |只看该作者

/etc/profile的疑问?

/bin/mail -E
case $? in
0)
echo "You have new mail."
;;
2)
echo "You have mail."
;;
esac
fi
esac

umask 022
trap 2 3

我是说profile没有这些内容

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
10 [报告]
发表于 2004-12-05 18:04 |只看该作者

/etc/profile的疑问?

原帖由 "wingger" 发表:
/bin/mail -E
case $? in
0)
echo "You have new mail."
;;
2)
echo "You have mail."
;;
esac
fi
esac

umask 022
trap 2 3

我是说profile没有这些内容

是系统不一样吧,我也没有这些内容!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP