1

To give context, I want to do something like an this: alias posix='man ?p', so that I could later type-in posix time and display time(1p), time(3p), etc..

Is this supported by man or will I have to hack something together with apropos?

Moth
  • 317
  • 1
  • 2
  • 6

1 Answers1

3

try either

MANSECT="1,2,3" man -a time
man -s 1,2,3 -a time

as per man itself

-S list, -s list, --sections=list The given list is a colon- or comma-separated list of sections, used to determine which manual sections to search and in what order. This option overrides the $MANSECT environment variable. (The -s spelling is for compatibility with System V.)

you will have to enumerate section, no range or wildcard.

Archemar
  • 31,183
  • 18
  • 69
  • 104
  • thank you. This is good enough for my use-case, and it also suggests that any kind of wildcarding will have to be done separate of `man` itself. – Moth Jun 12 '20 at 12:03
  • 1
    for future reference and the sake of completion, to achieve the wildcard constraint with the help of `-s` (and `-a` from the comment on my question), one could do something like `man -s $(echo /usr/share/man/man* |grep -o '[0-9]p' |paste -sd',') -a time` – Moth Jun 12 '20 at 12:14