On 2026-02-28 G. Branden Robinson wrote:

> Here it is as a shell function you can put in your
> .bashrc (or startup file for some other POSIX shell).
>
>     # Search for a word in a given man page.
>     #
>     # Equivalent examples (if using man-db man): tagman am 7 groff
>     #                                            tagman am 'groff(7)'
>     #                                            tagman am -s 7 groff
>     tagman () {
>       word=$1
>       shift
>       man "$@" | "${PAGER:-less}" -c '+/[^a-zA-Z0-9]'"$word"'[^a-zA-Z0-9]'
>     }

[ By accident, I sent this to Branden in private mail ]

Thanks for this, Branden.

Alexis: most(1) needs the "-r" switch to use regular expressions.

Regards,
Morten


Reply via email to