Discussion: grep 2 words
Afficher un message
Vieux 19/03/2008, 12h23   #2
Patrick
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: grep 2 words

thank you very much!!

pk ha scritto:

> Patrick wrote:
>
> > hi everyone, on solaris 10 without gnu shell, how can i do to grep 2
> > word. Or 1 or 2?
> > for example i'd like to grep all lines with Feb or Mar in this file:
> > Fri Feb 29 12:00:00 2008:
> > Fri Feb 29 12:30:00 2008:
> > Fri Feb 29 13:00:01 2008:
> > Fri Feb 29 13:30:00 2008:
> > Sat Mar 1 04:00:00 2008:
> > Sat Mar 1 04:30:00 2008:
> > Sat Mar 1 05:00:00 2008:
> > Sat Mar 1 05:30:00 2008:
> > Sat Mar 1 06:00:00 2008:

>
> egrep 'Feb|Mar' file.txt
>
> or
>
> awk '/Feb/ || /Mar/' file.txt
>
> --
> All the commands are tested with bash and GNU tools, so they may use
> nonstandard features. I try to mention when something is nonstandard (if
> I'm aware of that), but I may miss something. Corrections are welcome.

  Réponse avec citation
 
Page generated in 0,04565 seconds with 9 queries