whatis.sh

来自「操作系统源代码」· Shell 代码 · 共 51 行

SH
51
字号
#!/bin/sh## whatis/apropos 1.3 - search whatis(5) database for commands#							Author: Kees J. Bot# BUGS#	whatis file must be as if created by makewhatis(8).#all='exit 0'case "$1" in-a)	all="found='exit 0'"	shiftesaccase $#:$0 in1:*whatis)	;;1:*apropos)	all="found='exit 0'"	;;*)	echo "Usage: `basename $0` [-a] <keyword>" >&2	exit 1esacIFS=":$IFS"MANPATH="${MANPATH-/usr/local/man:/usr/man}"found=for m in $MANPATHdo	for w in $m/whatis	do		test -f $w || continue		case $0 in		*whatis)			grep "^($1|[^(]* $1)[ ,][^(]*\\(" $w && eval $all			;;		*apropos)			grep -i "$1" $w && eval $all		esac	donedone$foundecho "`basename $0`: $1: not found" >&2exit 1

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?