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

Use grep -q parameter instead of redirect to /dev/null #1741

Conversation

PeterDaveHello
Copy link
Collaborator

We don't need to use a longer command to redirect the standard output but we can directly ask grep to be quiet :)

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine, except I'm not sure what the support for -q is. Could you verify that it's in POSIX and when it was introduced?

@PeterDaveHello
Copy link
Collaborator Author

I think this page: https://www.unix.com/man-page/posix/1P/grep/ explained it's in POSIX?

@PeterDaveHello
Copy link
Collaborator Author

I don't know how to confirm the POSIX part, any idea?
At least busybox implemented it at 1999, I tested with ancient Ubuntu 10.04, CentOS 5, Debian 6, they all support this parameter, should be good enough?

@ljharb ljharb force-pushed the leaverage-grep-q-instead-of-rdr-to-dev-null branch from 225736c to 5f53caa Compare February 25, 2018 18:17
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, thanks.

@ljharb ljharb merged commit 5f53caa into nvm-sh:master Feb 25, 2018
@PeterDaveHello PeterDaveHello deleted the leaverage-grep-q-instead-of-rdr-to-dev-null branch February 25, 2018 18:32
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