Bug 62606 - apropos (man -k) generating invalid grep arguments
apropos (man -k) generating invalid grep arguments
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: man (Show other bugs)
7.2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Eido Inoue
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-02 18:49 EST by Eric Gregory
Modified: 2007-04-18 12:41 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-06 15:41:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Gregory 2002-04-02 18:49:16 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux 2.4.9-13psmp i686)

Description of problem:
apropos or man -k does not yield correct results.
Most of the time, it simply reports 'nothing apropriate'.


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


How reproducible:
Always

Steps to Reproduce:
% apropos paint

Actual Results:  % apropos paint
paint: nothing appropriate

Expected Results:  % apropos paint
gimp                 (1)  - an image manipulation and paint program
macptopbm            (1)  - convert a MacPaint file into a portable bitmap
pbmtomacp            (1)  - convert a portable bitmap into a MacPaint file
pgmoil               (1)  - turn a portable graymap into an oil painting
pjtoppm              (1)  - convert an HP PaintJet file to a portable pixmap
ppmtopj              (1)  - convert a portable pixmap to an HP PaintJet file
ppmtopjxl            (1)  - convert a portable pixmap into an HP PaintJet XL PCL
file
xpaint               (1x)  - Simple Paint program

Additional info:

The problem appears to be a typo in /usr/bin/apropos. 

In constructing the arg list to grep (lines 77,111),
it incorrectly  concatenates the supplied search term
to the second half of the options string. 

The fix is trivial. 
Lines 77 and 111 should be changed as follows: 
 77c77 
 < if grep -"$grepopt1"q "$grepopt2""$1" $d/whatis > /dev/null 
 --- 
 > if grep -"$grepopt1"q"$grepopt2" "$1" $d/whatis > /dev/null 
 111c111 
 < if grep -"$grepopt1" "$grepopt2""$1" $d/whatis 
 --- 
 > if grep -"$grepopt1""$grepopt2" "$1" $d/whatis
Comment 1 Eido Inoue 2003-01-06 15:41:57 EST
works in man-1.5j-11
Comment 2 Mark J. Cox (Product Security) 2003-04-28 08:45:57 EDT
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2003-134.html

Note You need to log in before you can comment on or make changes to this bug.