URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=14946>
Summary: "grep -P" doesn't support pattern lists Project: grep Submitted by: charles_levert Submitted on: Thu 11/10/05 at 04:08 Category: None Severity: 2 - Minor Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open _______________________________________________________ Details: 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'"). _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=14946> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/