📄 sufind2.sh
字号:
#! /bin/sh# /*********************** self documentation **********************/# SUFIND - get info from self-docs## Usage: sufind [-v -n] string## sufind string gives a brief synopsis# sufind -v string is a verbose hunt for relevant items# sufind -n name_fragment searches for command name## /**************** end self doc ********************************/# $Source: /usr/local/cwp/src/su/shell/RCS/sufind2.sh,v $# $Revision: 1.1 $ ; $Date: 1999/05/12 22:15:38 $# test for CWPROOTif 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}BIN=$ROOT/binSRC=${CWPSRC}/srcDOC=$SRC/doc/StrippedPATH=${PATH}:${BIN}cmd=`basename $0`case $# in0) echo "$cmd - get info from self-docs about SU programs" echo "Usage: $cmd [-v -n] string" 1>&2 echo "\"$cmd string\" gives brief synopses" 1>&2 echo "\"$cmd -v string\" verbose hunt for relevant items" 1>&2 echo "\"$cmd -n name_fragment\" searches for command name" 1>&2 exit 1;;esaccase $1 in-v) shift case $# in 0) echo "Need a string" 1>&2 echo "Usage: $cmd [-v -n] string" 1>&2; exit 1 ;; *) cd $DOC echo "" grep -i "$1" * ;; esac;;-n) shift string=`echo $1 | tr "[a-z]" [A-Z]"` cd $DOC echo "" grep "$string" * | sed "s/^.*$1.*://";;*) cd $DOC echo "" if grep -i "$1" * >/dev/null then for i in `grep -li "$1" *` do cat $i | sed 4q echo "" done fi;;esacecho ""echo "For more information type: \"sudoc program_name <CR>\""exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -