文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>shell编程例子

shell编程例子

时间:2007-02-17  来源:PHP爱好者

*****************************************************************
# * *
# * *
# *****************************************************************
#
# 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
#***************************************************************
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 = "${PROJ_DIR}/login"
set path_project_com = "${path_project_login}/com"

#***************************************************************
# definitions make
#***************************************************************
if ( -r "${path_project_com}/def_make" ) then
source ${path_project_com}/def_make
endif

#***************************************************************
# definitions path
#***************************************************************
if ( -r "${path_project_com}/def_path" ) then
source ${path_project_com}/def_path
endif

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

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

#***************************************************************
# welcome
#***************************************************************
if ( -r "${path_project_com}/welcome" ) then
source ${path_project_com}/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 = "${PROJ_DIR}/login/com"
set path_project_com2 = "${path_project_com1}/com"

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

# make environments
alias mkglb "make -f ${PROJ_DIR}/glb/work/etc/glb.mkf"
alias mkutl "make -f ${PROJ_DIR}/utl/work/etc/utl.mkf"
alias mkcomtcp "make -f ${PROJ_DIR}/comtcp/work/etc/comtcp.mkf"
alias mkuserlib "make -f ${PROJ_DIR}/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 = "${PROJ_DIR}/login/com"
set path_project_com2 = "${path_project_com1}/com"

#***************************************************************
# make settings
#***************************************************************
# Add setenv debug=1 by zzy 2000-08-07
setenv debug 1
setenv OS unix
setenv OSVERS
setenv GLOBAL_MKF_HOME ${PROJ_DIR}/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 ($?path) then
set path=($HOME/userlib $path)
else
set path=($HOME/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 = "${PROJ_DIR}/login/com"
set path_project_com2 = "${path_project_com1}/com"

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

# make environments
alias mkglb "make -f ${PROJ_DIR}/glb/work/etc/glb.mkf"
alias mkutl "make -f ${PROJ_DIR}/utl/work/etc/utl.mkf"
alias mkcomtcp "make -f ${PROJ_DIR}/comtcp/work/etc/comtcp.mkf"
alias mkuserlib "make -f ${PROJ_DIR}/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 = "${PROJ_DIR}/login/com"
set path_project_com2 = "${path_project_com1}/com"

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

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

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

#*******************************************************
#* Copyright (C) BS 2000. All Rights Reserved. Confidental *
#*******************************************************
php爱好者站 http://www.phpfans.net 文章|教程|下载|源码|论坛.
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载