helpDatabase-driven manual pager suite - Support: sr #108684, "man -k -l word" does...


sr #108684: "man -k -l word" does not show full header line

Submitted by:  Dale Worley <worley>
Submitted on:  Thu 13 Nov 2014 04:59:13 PM UTC  
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Thu 13 Nov 2014 04:59:13 PM UTC, original submission:  

(Brought upstream from

Description of problem:

The manual page for "man" gives this form for getting summary lines:

       man -k [apropos options] regexp ...

The manual page for "apropos" shows that the -l option can be used to prevent trimming of displayed lines to the terminal width.  Nonetheless, the form:

       man -k -l regexp

does not show the full lines, they are trimmed to the terminal width.  (No error message is given, either.)

Version-Release number of selected component (if applicable):


How reproducible:

Reliably reproducible.

Steps to Reproduce:
1. "man -k -l attribute"

Actual results:

Displayed lines are truncated to terminal width.  E.g.,

add_wchnstr (3x)     - add an array of complex characters (and attributes) to ...

Expected results:

The same output as for "apropos -l", that is, not truncated.  E.g.,

add_wchnstr (3x)     - add an array of complex characters (and attributes) to a curses window

Additional info:

The Red Hat people fixed their version so that -l after -k would be passed on to apropos.  This solves my immediate problem but does not bring man into compliance with its manual page.

Given the simplicity of the "man -k" form, I'd think it would be easier to invoke apropos directly, just passing it the remaining arguments without any analysis:

char * const new_argv = malloc(argc sizeof (char * const));
new_argv[0] = "apropos";
memcpy(new_argv + 1, argv + 2, (argc - 1) * sizeof (char * const));
execvp("apropos", new_argv);

That way man doesn't need to know anything about the arguments to apropos in order to support them all.

This does introduce additional complexity into the processing of the -k option, but that seems to be supportable because the documented use of -k is very restrictive:  It must appear alone as the first option.  So if -k is seen as ARGV[1], it would be processed as shown above, and if it is a later option, it is an error.

Dale Worley <worley>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by worley (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.7