I'm trying to pipe the output of a grep search into the input of another grep. Such as:
grep search_query * | grep -v but_not_this
But the second grep is not using the output of the previous search. It looks like the second grep is just using * instead. For example,
grep lcov *
tst/bits/Module.mk:21:$(call func_report_lcov)
tst/drivers/Module.mk:27:$(call func_report_lcov)
But when I want to filter out the results containing "call",
grep lcov * | grep -v call
...
Grep gives me every single line in my workspace that doesn't contain "call".
Environment Info:
- This is happening in both bash and fish
- I have aliased the grep command like so
alias grep='grep -nR --color=always'
Anything else I might be missing?
grep
does not descend into subdirectories without the-r/-R
option. Do you have a function or script namedgrep
? What doestype -a grep
show (in bash)?