Bug 1103270 - undocumented option --fixed-regexp
Summary: undocumented option --fixed-regexp
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: grep
Version: 6.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Jan Kepler
URL:
Whiteboard:
Depends On: 1103259
Blocks: 1159825
TreeView+ depends on / blocked
 
Reported: 2014-05-30 14:51 UTC by Martin Frodl
Modified: 2015-07-22 06:18 UTC (History)
4 users (show)

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.
Clone Of: 1103259
Environment:
Last Closed: 2015-07-22 06:18:07 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1447 normal SHIPPED_LIVE Low: grep security, bug fix, and enhancement update 2015-07-20 18:43:55 UTC

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


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