Bug 62606

Summary: apropos (man -k) generating invalid grep arguments
Product: [Retired] Red Hat Linux Reporter: Eric Gregory <ericg>
Component: manAssignee: Eido Inoue <havill>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-06 20:41:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eric Gregory 2002-04-02 23:49:16 UTC
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 20:41:57 UTC
works in man-1.5j-11

Comment 2 Mark J. Cox 2003-04-28 12:45:57 UTC
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