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

allow specifying files to search from via stdin, eg: find / | rg pattern --stdin #1727

Closed
timotheecour opened this issue Nov 8, 2020 · 1 comment
Labels
duplicate An issue that is duplicative of another.

Comments

@timotheecour
Copy link

Describe your feature request

I'd like to allow searching for a pattern in files specified via stdin, eg: find / | rg pattern --stdin
note that find / | rg pattern - is different, as it treats stdin as a file and searches for a pattern there.

The motivation is it allows separation of concerns, eg using some program to specify which files you're interested in searching from, and then asking ripgrep to search for content among those.

@timotheecour timotheecour changed the title allow specifying files to search from via stdin allow specifying files to search from via stdin, eg: find / | rg pattern --stdin Nov 8, 2020
@BurntSushi
Copy link
Owner

You can do this with xargs: find / -print0 | xargs -0 rg pattern.

See also #273. Which I've just re-opened.

@BurntSushi BurntSushi added the duplicate An issue that is duplicative of another. label Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate An issue that is duplicative of another.
Projects
None yet
Development

No branches or pull requests

2 participants