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?

2
  • like man -a time ?
    – Archemar
    Jun 12, 2020 at 11:21
  • that would get me all sections, I want within a set section range i.e. [1-3] or ?p or 1*
    – Moth
    Jun 12, 2020 at 11:46

1 Answer 1

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.

2
  • 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, 2020 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, 2020 at 12:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .