热门关键字:  ubuntu  分区  函数  Fedora  linux系统进程

当前位置 :| 主页>Linux教程>Shell开发>

shell编程例子 -- 一个.cshrc例子

来源: 作者: 时间:2007-01-28 Tag: 点击:
 *****************************************************************
# * *
# * *
# *****************************************************************
#
# HISTORY

# @(#)$RCSfile: .cshrc,v $ $Revision: 4.1.3.3 $ (DEC) $Date: 1992/05/11 09:13:09 


setenv MAIL /usr/spool/mail/$USER
#******************************************************************************
#******************************************************************************
#
# add by zzy 2000.08.06
#
#******************************************************************************
#******************************************************************************
# set pics environment
#******************************************************************************
#source /etc/pics.d/picsenv.csh
#******************************************************************************
# set innovator environment
#******************************************************************************
#source /usr/innovator/inoenv.csh
#******************************************************************************
# set PCFC application environment
#******************************************************************************
source ${HOME}/app_login
#******************************************************************************
# change path to home path 
#******************************************************************************
cd ${HOME}
#******************************************************************************
app_login:
==========
#******************************************************************************
#* module: app_login
#* description: app login
#* This script must be called in the login file
#* with the command 'source app_login'
#* author: zzy
#* version: 31.08.1998
#******************************************************************************

#******************************************************************************
# entry
#******************************************************************************

#******************************************************************************
# environment
#******************************************************************************
set say = "echo"
set mode = ""
set node = "`uname -n`"
set user = "`logname`"

#******************************************************************************
# this path and this script
#******************************************************************************
set this_path1 = "`dirname ${HOME}/x`"
set this_script1 = "app_login"

if ( ! -f ${this_path1}/${this_script1} ) then
$say 'this script must be in the directory $HOME'
goto exit
endif

#******************************************************************************
# start message
#******************************************************************************
$say " %$this_script1, `date '+%H:%M:%S'` start executing on $node"

#******************************************************************************
# set project and channel prefix for all user
#******************************************************************************
if ( "$user" == "root" ) then
setenv PROJ pcfc
setenv CPRE ""
endif

if ( "$user" == "pcfc" ) then
setenv PROJ pcfc
setenv CPRE ""
endif

if ( "$user" == "picsadm" ) then
setenv PROJ baoshan
setenv CPRE ""
endif

if ( "$user" == "picsvis" ) then
setenv PROJ baoshan
setenv CPRE ""
endif

if ( "$user" == "" ) then
setenv PROJ pcfc
setenv CPRE ""
endif

#******************************************************************************
# set project directory
#******************************************************************************
setenv PROJ_DIR /home/$PROJ

#******************************************************************************
# call project application login
#******************************************************************************
if ( -f "${this_path1}/${this_script1}_$PROJ" ) then
$say " %$this_script1, call project application login"
source ${this_path1}/${this_script1}_$PROJ
endif

#******************************************************************************
# end message
#******************************************************************************
#$say " %$this_script1, `date '+%H:%M:%S'` finished"

#******************************************************************************
# exit
#******************************************************************************
exit:
unset this_path1
unset this_script1
exit

#******************************************************************************

app_login_pcfc
==============
#******************************************************************************
#* module: application_login_$PROJ
#* description: application login for a project
#* This script must be called in the login file app_login
#* with the command 'source app_login_$PROJ'
#* author: Zhou zeyan 
#* 
#* version: 8.1.2000
#******************************************************************************

#******************************************************************************
# entry
#******************************************************************************

#******************************************************************************
# environment
#******************************************************************************
set say = "echo"
set mode = ""
最新评论共有 4 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册