buggrep - Bugs: bug #14946, "grep -P" doesn't...


You are not allowed to post comments on this tracker with your current authentication level.

bug #14946: "grep -P" doesn't support pattern lists

Submitter:  Charles Levert <charles_levert>
Submitted:  Thu 10 Nov 2005 04:08:59 AM UTC
Category:  None Severity:  2 - Minor
Item Group:  None Status:  Postponed
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Fri 11 Nov 2005 10:40:46 AM UTC, comment #1: 

Upon reflection, my proposed solution would not work, so I at least added an error and a message for this situation.  This is trivial and will do for now.  Details in the ChangeLog.

CVS commit:
  ChangeLog 1.282
  src/search.c 1.39

Charles Levert <charles_levert>
Thu 10 Nov 2005 04:08:59 AM UTC, original submission:  

Traditional fgrep and POSIX grep have support for a pattern list, instead of a single pattern.  GNU grep inherited this, and it can be specified with multiple -e arguments, a -f file, or just by embedding newlines in a pattern argument.

"grep -P" currently does not do anything to recognize a pattern list from a single pattern.  Therefore, it doesn't work, but there is also no run-time warning about it being unsupported.

Since "grep -P" is low priority, I only give this a severity of 'minor'.

Would replacing each newline character in the aggregated pattern by a vertical line character do the trick?  Just as the tricks that are used to support -w and -x, this can be abused by a user who intentionally feeds in an invalid pattern or pattern list (e.g., "echo 'x y z' | grep -P -w --color 'x) y (z'").

Charles Levert <charles_levert>


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

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2005-11-11 charles_levert StatusNone Postponed

Back to the top

Powered by Savane 3.13-b921.
Corresponding source code