On 8/31/22 14:01, Alejandro Colomar wrote:
man_section() { if [ $# -lt 2 ]; then >&2 echo "Usage: ${FUNCNAME[0]} <dir> <section>..."; return $EX_USAGE; fi local page="$1"; shift; local sect="$*"; find "$page" -type f \ |xargs wc -l \ |grep -v -e '\b1 ' -e '\btotal\b' \ |awk '{ print $2 }' \ |sort \ |while read -r manpage; do (sed -n '/^\.TH/,/^\.SH/{/^\.SH/!p}' <"$manpage"; for s in $sect; do <"$manpage" \ sed -n \ -e "/^\.SH $s/p" \ -e "/^\.SH $s/,/^\.SH/{/^\.SH/!p}"; done;) \ |man -P cat -l - 2>/dev/null; done; } And the list is:
And the list for man3 is a bit shorter:$ man_section man3 ERRORS | grep -e '^\w*(3)' -e '^ E' | grep -o '^ *[^ ]*' | sed '/^\w/p' | uniq -d | tac | sed -n '/^ /,/^[^ ]/p' | tac | tee /dev/tty | wc -l
FPATHCONF(3) EINVAL FUTIMES(3) ENOSYS GETCWD(3) EINVAL GETENTROPY(3) EIO KILLPG(3) ESRCH LIO_LISTIO(3) EAGAIN MKFIFO(3) ENOTDIR MQ_OPEN(3) EACCES EINVAL ENOENT NEWLOCALE(3) EINVAL POSIX_MADVISE(3) EINVAL PTHREAD_ATTR_SETAFFINITY_NP(3) EINVAL PTHREAD_CREATE(3) EAGAIN PTHREAD_JOIN(3) EINVAL PTHREAD_SETAFFINITY_NP(3) EINVAL PTHREAD_SETCANCELSTATE(3) EINVAL PTHREAD_SETNAME_NP(3) ERANGE RANDOM(3) EINVAL RANDOM_R(3) EINVAL SCANDIR(3) ENOTDIR SEM_OPEN(3) EINVAL SEM_WAIT(3) EINVAL SHM_OPEN(3) EACCES ENOENT 47 -- Alejandro Colomar <http://www.alejandro-colomar.es/>
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature