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

王朝other·作者佚名  2006-11-24
窄屏简体版  字體: |||超大  

*****************************************************************

# * *

# * *

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

#

# 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 = ""

set node = "`uname -n`"

set user = "`logname`"

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

# this path and this script

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

set this_path2 = "`dirname ${HOME}/x`"

set this_script2 = "app_login_$PROJ"

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

# start message

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

$say " %$this_script2, `date '+%H:%M:%S'` start executing on $node"

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

# history

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

set history=40

alias h history

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

# aliases

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

alias sql sqlplus pcfcadm/pcfcadm

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

# set environment for components

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

set cmp = glb

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = utl

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = com

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = log

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = tel

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = mva

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = mtr

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = mm

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = de

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = se

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = comtcp

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

set cmp = sdd

if ( -r "${PROJ_DIR}/${cmp}/etc/${cmp}_init" ) then

source ${PROJ_DIR}/${cmp}/etc/${cmp}_init

endif

unset cmp

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

# set environment for project

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

if ( -r "${PROJ_DIR}/login/login" ) then

source ${PROJ_DIR}/login/login

endif

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

# end message

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

#$say " %$this_script2, `date '+%H:%M:%S'` finished"

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

# unset

#****

[1] [2] [3] 下一页

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航