Hi.

On Sat, 21 Sep 2013 21:12:36 +0300
Alexander Kapshuk <alexander.kaps...@gmail.com> wrote:

> I could be wrong, but doesn't egrep, which supports extended regular 
> expressions, fit the bill?
> 
> =; echo two words > grep-AND-test1
> =; echo two > grep-AND-test2
> =; echo words >> grep-AND-test2
> 
> =; egrep 'two|words' grep-AND-test*
> grep-AND-test1:two words
> grep-AND-test2:two
> grep-AND-test2:words

You're wrong indeed, as '|' means 'or', not 'and'.

$ echo two > grep-AND-test3
$ egrep 'two|words' grep-AND-test3
two

Please note that 'two.*words' won't be the solution (as 'words' can be
placed before 'two'), and even '(two.*words|words.*two)' won't be the
solution either ('two' and 'words' can be in a different rows of file).

Reco


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/20130921230559.007126c4783b01f08f766...@gmail.com

Reply via email to