Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grep -E -> grep -P #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

grep -E -> grep -P #2

wants to merge 1 commit into from

Conversation

cepal
Copy link

@cepal cepal commented Aug 30, 2019

this change makes ptrap work on older distros like RHEL5 where "grep -E" works differently and doesn't provide intended result.

this change makes ptrap work on older distros like RHEL5 where "grep -E" works differently and doesn't provide intended result.
@mvitale1989
Copy link
Owner

Hi cepal. Thanks for your contribution!
I am not confident in defaulting to -P, as the grep manpage on my Ubuntu 18.04 reports the following:

Perl-compatible regular expressions give additional functionality, and are documented in pcresyntax(3) and pcrepattern(3), but work only if PCRE is available in the system.

A nicer alternative would be making it configurable instead, like having a variable GREP_MATCHER that defaults to -E but can be set to -P on older systems, .e.g. letting you run GREP_MATCHER="-P" ptrap ... instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants