首页 > 编程开发 > Shell > 正文  
shell编程例子 -- 一个.cshrc例子
2002年02月04日 15:01
*****************************************************************
# * *
# * *
# *****************************************************************
#
# HISTORY
#
# @(#): .cshrc,v : 4.1.3.3 502 502DEC) : 1992/05/11 09:13:09
501br>#
setenv MAIL /usr/spool/mail/
#******************************************************************************
#******************************************************************************
#
# 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 /app_login
#******************************************************************************
# change path to home path
#******************************************************************************
cd
#******************************************************************************
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 /x`"
set this_script1 = "app_login"

if ( ! -f / ) then
'this script must be in the directory '
goto exit
endif

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

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

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

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

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

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

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

#******************************************************************************
# call project application login
#******************************************************************************
if ( -f "/_" ) then
" %, call project application login"
source /_
endif

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

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

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

app_login_pcfc
==============
#******************************************************************************
#* module: application_login_
#* description: application login for a project
#* This script must be called in the login file app_login
#* with the command 'source app_login_'
#* 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 /x`"
set this_script2 = "app_login_"

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

#******************************************************************************
# history
#******************************************************************************
set history=40
alias h history

#******************************************************************************
# aliases
#******************************************************************************
alias sql sqlplus pcfcadm/pcfcadm

#******************************************************************************
# set environment for components
#******************************************************************************

set cmp = glb
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = utl
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = com
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = log
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = tel
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = mva
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = mtr
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = mm
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = de
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = se
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = comtcp
if ( -r "//etc/_init" ) then
source //etc/_init
endif
set cmp = sdd
if ( -r "//etc/_init" ) then
source //etc/_init
endif
unset cmp

#******************************************************************************
# set environment for project
#******************************************************************************
if ( -r "/login/login" ) then
source /login/login
endif

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

#******************************************************************************
# unset
#******************************************************************************
exit:
unset this_path2
unset this_script2
exit
#******************************************************************************

login
========
#******************************************************************************
#* module: login
#* description: project login definitions
#* author: Zhou zeyan
#* version: 31.08.2000
#******************************************************************************

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

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

#******************************************************************************
# pathes
#******************************************************************************
set path_project_login = "/login"
set path_project_com = "/com"

#******************************************************************************
# definitions make
#******************************************************************************
if ( -r "/def_make" ) then
source /def_make
endif

#******************************************************************************
# definitions path
#******************************************************************************
if ( -r "/def_path" ) then
source /def_path
endif

#******************************************************************************
# definitions unix commands
#******************************************************************************
if ( -r "/def_unix" ) then
source /def_unix
endif

#******************************************************************************
# definitions user commands
#******************************************************************************
if ( -r "/def_user" ) then
source /def_user
endif

#******************************************************************************
# welcome
#******************************************************************************
if ( -r "/welcome" ) then
source /welcome
endif

#******************************************************************************
# exit
#******************************************************************************
unset path_project_login
unset path_project_com
exit

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

def_unix
========
#******************************************************************************
#* module: def_user
#* description: user command settings
#* author: Zhou zeyan
#* version: 31.08.2000
#******************************************************************************

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

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

#******************************************************************************
# pathes
#******************************************************************************
set path_project_com1 = "/login/com"
set path_project_com2 = "/com"

#******************************************************************************
# user command settings
#******************************************************************************
alias cdproj "cd "
alias cdmkf "cd /mkf"
alias cdglb "cd /glb"
alias cdutl "cd /utl"
alias cdcom "cd /com"
alias cdlog "cd /log"
alias cdtel "cd /tel"
alias cdtools "cd /tools"
alias cdcomtcp "cd /comtcp"
alias cdexport "cd /export"
alias cdoracle "cd /oracle"
alias cdsystem "cd /system"
alias cds "cd /home/zzy/system"
alias cdbuild "cd /oracle/build"
alias cdzzy "cd /home/zzy"

# make environments
alias mkglb "make -f /glb/work/etc/glb.mkf"
alias mkutl "make -f /utl/work/etc/utl.mkf"
alias mkcomtcp "make -f /comtcp/work/etc/comtcp.mkf"
alias mkuserlib "make -f /userlib/userlib.mkf"

#******************************************************************************
# exit
#******************************************************************************
unset path_project_com1
unset path_project_com2
exit

#******************************************************************************
def_make
============
#******************************************************************************
#* Copyright (C) BS P4 2000. All Rights Reserved. Confidental *
#******************************************************************************

#******************************************************************************
#* module: def_make
#* description: make settings
#* author: Zhou zeyan
#* version: 31.08.2000
#******************************************************************************

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

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

#******************************************************************************
# pathes
#******************************************************************************
set path_project_com1 = "/login/com"
set path_project_com2 = "/com"

#******************************************************************************
# make settings
#******************************************************************************
# Add setenv debug=1 by zzy 2000-08-07
setenv debug 1
setenv OS unix
setenv OSVERS
setenv GLOBAL_MKF_HOME /mkf/

#******************************************************************************
# exit
#******************************************************************************
unset path_project_com1
unset path_project_com2
exit

#******************************************************************************
#* Copyright (C) BS P4 2000. All Rights Reserved. Confidental *
#******************************************************************************

def_path
============
#******************************************************************************
#* Copyright (C) BS P4 2000. All Rights Reserved. Confidental *
#******************************************************************************

#******************************************************************************
#* module: def_path
#* description: path settings
#* author: Zhou zeyan
#* version: 31.08.2000
#******************************************************************************

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

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

#******************************************************************************
# path settings
#******************************************************************************
if (0path) then
set path=(/userlib )
else
set path=(/bin /usr/bin .)
endif

#******************************************************************************
# exit
#******************************************************************************
exit

#******************************************************************************
#* Copyright (C) BS P4 2000. All Rights Reserved. Confidental *
#******************************************************************************

def_user
============
#******************************************************************************
#* Copyright (C) BS P4 2000. All Rights Reserved. Confidental *
#******************************************************************************

#******************************************************************************
#* module: def_user
#* description: user command settings
#* author: Zhou zeyan
#* version: 31.08.2000
#******************************************************************************

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

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

#******************************************************************************
# pathes
#******************************************************************************
set path_project_com1 = "/login/com"
set path_project_com2 = "/com"

#******************************************************************************
# user command settings
#******************************************************************************
alias cdproj "cd "
alias cdmkf "cd /mkf"
alias cdglb "cd /glb"
alias cdutl "cd /utl"
alias cdcom "cd /com"
alias cdlog "cd /log"
alias cdtel "cd /tel"
alias cdtools "cd /tools"
alias cdcomtcp "cd /comtcp"
alias cdexport "cd /export"
alias cdoracle "cd /oracle"
alias cdsystem "cd /system"
alias cds "cd /home/zzy/system"
alias cdbuild "cd /oracle/build"
alias cdzzy "cd /home/zzy"

# make environments
alias mkglb "make -f /glb/work/etc/glb.mkf"
alias mkutl "make -f /utl/work/etc/utl.mkf"
alias mkcomtcp "make -f /comtcp/work/etc/comtcp.mkf"
alias mkuserlib "make -f /userlib/userlib.mkf"

#******************************************************************************
# exit
#******************************************************************************
unset path_project_com1
unset path_project_com2
exit

#******************************************************************************
#* Copyright (C) BS P4 2000. All Rights Reserved. Confidental *
#******************************************************************************

welcome
==========
#******************************************************************************
#* Copyright (C) BS 2000. All Rights Reserved. Confidental *
#******************************************************************************

#******************************************************************************
#* module: welcome
#* description: welcome
#* author: Zhou zeyan
#* version: 31.08.2000
#******************************************************************************

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

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

#******************************************************************************
# pathes
#******************************************************************************
set path_project_com1 = "/login/com"
set path_project_com2 = "/com"

#**********************************************************************
# welcome
#**********************************************************************
set text6=" user: "
set text7=" node: "

echo ""
echo "======================================================================="
echo ""
echo " +-----------------------------------------------------+"
echo " | |"
echo " | ###### ####### ####### ####### |"
echo " | # # # # # |"
echo " | # # # # # |"
echo " | ###### # ####### # |"
echo " | # # # # |"
echo " | # # # # |"
echo " | # ####### # ####### |"
echo " | |"
echo " +-----------------------------------------------------+"
echo ""
echo "======================================================================="
echo " B S"
echo "======================================================================="
echo ""
echo ""
echo ""
echo "======================================================================="
echo ""
unset text6
unset text7

#**********************************************************************
# exit
#**********************************************************************
unset path_project_com1
unset path_project_com2
exit

#**********************************************************************
#* Copyright (C) BS 2000. All Rights Reserved. Confidental *
#**********************************************************************

】【http://www.trainlinux.com】【Close
『相关资料』
shell编程例子 -- 一个.login例子 (2002-02-02 14:58)
shell编程例子 -- 一个makefile例子 (2002-02-02 14:57)
Bash最常见的激活模式 (2002-02-02 14:57)
Bash中的变量 (2002-02-02 14:57)
Home 

诚恩Linux培训工作室