Bug 1103270

Summary: undocumented option --fixed-regexp
Product: Red Hat Enterprise Linux 6 Reporter: Martin Frodl <mfrodl>
Component: grepAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Jan Kepler <jkejda>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.6CC: dkutalek, jkejda, ovasik, rvokal
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: grep-2.20-1.el6 Doc Type: Bug Fix
Doc Text:
Cause: The option --fixed-regexp is obsoleted and wasn't mentioned in the manual page. Consequence: This could cause confusion, as the manual page is inconsistent with the built-in help of grep. Fix: The missed option was added to the manual page with the notice that it is obsoleted and shouldn't be used. Result: Now the built-in help and manual page are more consistent regarding the --fixed-regexp option.
Story Points: ---
Clone Of: 1103259 Environment:
Last Closed: 2015-07-22 06:18:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1103259    
Bug Blocks: 1159825    

Description Martin Frodl 2014-05-30 14:51:03 UTC
+++ This bug was initially created as a clone of Bug #1103259 +++

Description of problem:

The synonymous -F and --fixed-strings command-line options are used to interpret the pattern as a list of fixed strings, separated by newlines, any of which is to be matched. This is correctly mentioned both on the man page and in the usage message. Apart from these, however, the option --fixed-regexp appears to serve quite the same purpose, despite it not being documented anywhere.

$ echo 'studying' | grep -F 'dying'
studying
$ echo 'studying' | grep --fixed-strings 'dying'
studying
$ echo 'studying' | grep --fixed-regexp 'dying'
studying

Inasmuch as I could tell, this was probably the only undocumented option synonymous to -F. It does not work with an arbitrary string starting with the "--fixed-" prefix:

$ echo 'studying' | grep --fixed-fence 'dying'
grep: unrecognized option '--fixed-fence'
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.

To fix this bug, the --fixed-regexp command-line option should be either included in the documentation or wholly removed.


Version-Release number of selected component (if applicable):
grep-2.16-1.el7.x86_64


How reproducible:
always

Comment 1 Martin Frodl 2014-05-30 14:57:20 UTC
grep version mentioned in the description (grep-2.16-1.el7.x86_64) applies to the original RHEL 7 bug. For RHEL 6.6, the relevant version is grep-2.6.3-4.el6.x86_64.

Comment 2 Jaroslav Škarvada 2014-10-24 12:40:25 UTC
From the changelog:
 - The --fixed-regexp option has been renamed to --fixed-string.

Currently it's an alias to -F. I guess it was kept there for backward compatibility and removed from the docs for users not to use it. We may describe it in the man with the notice that it's obsoleted, can be removed anywhere and shouldn't be used.

Comment 9 errata-xmlrpc 2015-07-22 06:18:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-1447.html