[wellylug] Some help with grep

Enkidu enkidu at cliffp.com
Tue Jun 22 10:17:17 NZST 2004


Something like

perl -ne 'print if /Yes/ && /word1|word2|work3/ ' < file

might work. It does in my little test, assuming that I understand what
you are trying to do.

Cheers,

Cliff

On Tue, 22 Jun 2004 09:01:49 +1200 (NZST), you wrote:

>Thanks for that. Another question now :-)
>I'm pretty much a Perl newbie and would like to do a search similar to
>this but use logic like thisL
>
>find any occurance of the word 'Yes', then on the same line any occurance
>of the word 'word1' or the word 'word2' or word 'word3' etc.
>
>I've tried various options that I could think of but obviously Perl
>doesn't like the way I think!
>
>
>>
>> Use perl if you want just one command, instead of grep and grep -V:
>>
>>     perl -ne 'print if /@domain.co.nz/&&!/this_address at domain.co.nz/' <
>> file




More information about the wellylug mailing list