📄 updatedoc.sh
字号:
#! /bin/sh# /*********************** self documentation **********************/# UPDATEDOC - put self-docs in ../doc/Stripped and ../doc/Headers## Usage: updatedoc path## Notes:# Paths include: cwp/main cwp/lib cwp/shell par/main par/lib par/shell# xplot/main xplot/lib psplot/main psplot/lib psplot/shell# Xtcwp/main Xtcwp/lib su/main su/lib su/shell su/graphics/psplot# su/graphics/xplot tri/main tri/lib xtri tri/graphics/psplot# tetra/lib tetra/main# comp/dct/lib comp/dct/main comp/dct/libutil comp/dwpt/1d/lib# comp/dwpt/1d/main comp/dwpt/2d/lib comp/dwpt/2d/main# # Use: updatedocall to update full directory, use updatehead to# to update the master header file.## This shell builds the database used by suname and gendocs # /**************** end self doc ********************************/# Based on an original shell script by Jack K. Cohen## $Author: john $# $Source: /usr/local/cwp/src/par/shell/RCS/updatedoc.sh,v $# $Revision: 1.21 $ ; $Date: 2001/08/02 17:20:45 $#set -xcmd=`basename $0`case $# in 1) # ok ;; *) echo "Usage: $cmd path" echo echo "Paths include: cwp/main cwp/lib par/main par/lib par/shell " echo " xplot/main xplot/lib psplot/main psplot/lib " echo " Xtcwp/main Xtcwp/lib su/main su/lib su/graphics/psplot" echo " su/graphics/xplot " echo "su/graphics/xplot tri/main tri/lib xtri \ tri/graphics/psplot" echo " tetra/lib tetra/main " echo "comp/dct/lib comp/dct/main comp/dct/libutil \ comp/dwpt/1d/lib" echo "comp/dwpt/1d/main comp/dwpt/2d/lib comp/dwpt/2d/main" echo echo "Use: updatedocall to update the full doc directory" echo " updatehead to update the master header file" 2>&1 \ ; exit 1 ;;esac##################$############################################################# test for CWPROOT###############################################################################if test "${CWPROOT}" = ""then echo "The environment variable \"CWPROOT\" " echo "is not set in the user's working shell environment." echo "To set this variable in C-shell, use the command: " echo " setenv CWPROOT /your/cwp/root/path" echo "To set this variable in Bourne or Korn-shell, use the command:" echo " export CWPROOT=/your/cwp/root/path" ; exit 1fi################################################################################# test for CWPSRC, use value if set, define as $CWPROOT if not set# (CWPSRC allows one set of source code and documentation for multiple machines)################################################################################if test "${CWPSRC}" = ""thenCWPSRC=$CWPROOTfiROOT=${CWPROOT}SRC=${CWPSRC}/srcBIN=${ROOT}/binPATH=/bin:/usr/bin:/usr/ucb:$BINSRCDIR=${SRC}/$1if [ ! -d $SRCDIR ]then echo "Can't find directory $SRCDIR" 2>&1; exit 1fiDOC=${SRC}/docSTRIP=${DOC}/StrippedHEAD=${DOC}/HeadersNAME=`echo $1 | sed 's/\//\./g'`echo " Updating the $NAME doc files "echo# Clear out old stuff; remake $STRIP and $HEAD directoriesrm -rf $DOC/*/*.${NAME}# make directories if necessaryif [ ! -d $DOC ]then mkdir $DOCfiif [ ! -d $HEAD ]then mkdir $HEADfiif [ ! -d $STRIP ]then mkdir $STRIPfifor i in ${SRCDIR}/*.*do prog=`basename $i .c` nametemp=${prog}.${NAME} name=`echo $nametemp | sed 's/\.sh\./\./g'` sed -n '/* self documentation */,/* end self doc */p' $i | tee $DOC/$name | sed ' /\*\*\*\*\*/d s/^\/\*// s/^\/// s/^ \/// /^char \*sdoc/d s/\\\"/\"/g s/"[ ]*"\,// s/",$// s/^"// s/ \*\/// s/^ \*/\*/ /NULL}\;/d ' >$STRIP/$name # if 1st line is blank, delete it. LINE1=`cat $STRIP/$name | awk ' NR==1 { print $2 }'` if test "$LINE1" = "" then sed '1d' $STRIP/$name > $STRIP/$name.tmp mv $STRIP/$name.tmp $STRIP/$name fi # make headers sed 1q $STRIP/$name | sed 's/^ //' >>$HEAD/HEADERS.${NAME} # fix files where 'end self doc' appears twice # remove leading # or * cat $STRIP/$name | sed '/end self doc/,100d' | sed ' s/^\#// s/^\*//' > $STRIP/${name}.tmp mv $STRIP/${name}.tmp $STRIP/$name echo -n "." # remove unstripped versions rm $DOC/$namedoneechoecho " Doc ${NAME} files updated "exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -