"grep | xargs grep" with search conditions on different strings
I want to grep files that contain text "wp_" but do not contain text "wp3_". E.g. I've got a file with two strings:
>wp_123

>wp3_123

I try `$ grep -lr wp_ ~/tmp | xargs grep -vl wp3_`

It outputs this file name! But if I remove the linebreak, it's working like I want, i.e. handles string "wp_123 wp3_123" correctly.

How to make it work with search conditions on different strings?

P.S. Sorry for kind of duplicate, but seems that nobody noticed [my comment](http://stackoverflow.com/questions/10959666/another-grep-advanced#comment-14308071) during last hour...
"grep | xargs grep" with search conditions on different strings
===

I want to grep files that contain text "wp_" but do not contain text "wp3_". E.g. I've got a file with two strings:
>wp_123

>wp3_123

I try `$ grep -lr wp_ ~/tmp | xargs grep -vl wp3_`

It outputs this file name! But if I remove the linebreak, it's working like I want, i.e. handles string "wp_123 wp3_123" correctly.

How to make it work with search conditions on different strings?

P.S. Sorry for kind of duplicate, but seems that nobody noticed [my comment](http://stackoverflow.com/questions/10959666/another-grep-advanced#comment-14308071) during last hour...