You are not logged in.

#1 2013-03-10 16:14:56

jwilliamson
Member
Registered: 2013-03-10
Posts: 3

[SOLVED] Changing the order man searches its sections.

I would like to change man's behaviour so that it will display pages found in the second and third sections of the manual instead of the first.

Example:

man printf

would display printf(3) rather than printf(1).

I currently do this by adjusting the SECTION line of man_db.conf, but would like to do it with a dot file/environment variable.

Does anyone know how this might be done?

Last edited by jwilliamson (2013-03-10 17:57:52)

Offline

#2 2013-03-10 17:17:34

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Changing the order man searches its sections.

alias man="man 3"

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-03-10 17:47:16

jwilliamson
Member
Registered: 2013-03-10
Posts: 3

Re: [SOLVED] Changing the order man searches its sections.

That causes man to ignore the other sections of the manual.

alias man="man -S 3,2,1,n,l,8,0,5,4,9,6,7"

does seem to work.

Offline

#4 2013-03-10 17:55:28

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Changing the order man searches its sections.

You can always use the full path to override an alias...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2013-03-10 18:02:13

jwilliamson
Member
Registered: 2013-03-10
Posts: 3

Re: [SOLVED] Changing the order man searches its sections.

I'd have to override whenever I wanted a page not in section 3. man -S overrides the default, but is in turn overridden by the section argument.

Offline

#6 2013-03-10 19:28:22

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,727

Re: [SOLVED] Changing the order man searches its sections.

jasonwryan wrote:

You can always use the full path to override an alias...

Or precede the command with a backslash

Last edited by ewaller (2013-03-10 19:28:43)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2013-03-10 19:38:55

borzole
Member
Registered: 2013-03-10
Posts: 2

Re: [SOLVED] Changing the order man searches its sections.

You can use "\" operator for "in place" unalias.

$ alias man='bla bla bla'
$ man foo # this while use alias 
$ \man foo # this while use original man command

Offline

#8 2013-03-10 19:49:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Changing the order man searches its sections.

ewaller wrote:
jasonwryan wrote:

You can always use the full path to override an alias...

Or precede the command with a backslash


Nice! Thanks ewaller.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB