Re: grep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le dimanche 30 Janvier 2005 19:48, Bill Gradwohl a écrit :
> According to the grep man page:
> Grep understands two different versions of regular expression syntax:
> “basic” and “extended.” In GNU grep, there is no difference in avail-
> able functionality using either syntax.
>
> However, the following function differently:
> grep -G 'cat|dog|bird' filename (Basic)
> grep -E 'cat|dog|bird' filename (Extended)
>
> Am I interpreting something incorrectly?
>
> The command :
> grep -E 'cat|dog|bird' filename
> will output any line that contains cat OR dog OR bird or any combination.
>
> Does anyone know how to construct a regular expression or in any way get
> a single grep execution to do an AND instead of an OR operation so that
> it looks for more that one string and matches a line when ALL the items
> exist on that line, and are possibly in RANDOM order?
>
> i.e. Find these lines
> cat dog bird
> bird dog cat
> dog cat bird
> etc.
>
> --
> Bill Gradwohl
> bill@xxxxxxx
> http://www.ycc.com
> spamSTOMPER Protected email

hi , 

heu if you to search an expression in the file or declaration 

use this cmd line : 

find . -name ' * ' |xargs grep "bird" 2>/dev/null

exmple : i search my function toto in 20 files in my local path 
i use : 
find . -name ' * ' |xargs grep "toto" 2>/dev/null
bye ...
alexandre Priou   


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux