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 -P is not always available. #84

Open
copiousfreetime opened this issue Dec 8, 2015 · 2 comments
Open

grep -P is not always available. #84

copiousfreetime opened this issue Dec 8, 2015 · 2 comments

Comments

@copiousfreetime
Copy link

The default search_ backend is effecively grep -P which is not available in all grep implementations. For instance many BSD's including OS X.

@fmoralesc
Copy link
Owner

Any ideas how to detect this without having to run and parse grep --version?

@copiousfreetime
Copy link
Author

I'd say check the exit status. If the exit status is >1 then there was an error.

% uname -s
Linux
% echo 'testing P' | grep -P test > /dev/null 2>&1
% echo $?
0
% uname -s
Darwin
% echo 'testing P' | grep -P test > /dev/null 2>&1
% echo $?
2

fmoralesc added a commit that referenced this issue Apr 23, 2016
fmoralesc added a commit that referenced this issue Apr 23, 2016
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

No branches or pull requests

2 participants