Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] grep sort of thing
- Date: Wed, 11 Jun 2003 16:16:17 +0900
- From: Brett Robson <b-robson@example.com>
- Subject: Re: [tlug] grep sort of thing
- References: <1055371391.9866.6.camel@example.com> <1055373247.9865.23.camel@example.com>
> On Wed, 2003-06-11 at 15:43, David Blomberg wrote: > > On Tue, 2003-06-10 at 23:03, Brett Robson wrote: > > > Hi all, > > > > > > There must be a simple way to do this but I can't work it out. > > > > > > I want to display strings from a text file(s) based on a reg exp, sort > > > of like egrep but only displaying the matched string not the whole line > > > from the file. > > > > > > Thanks > > > Brett > > > > cat $file | grep $entry | echo $entry > > > uh oh open mouth insert foot strikes again > > if you are looking for the number of lines the word occurs on: > > cat /dir/file | grep WORD | wc -l > > or are you trying to print the word for each time it appears? > No, the search expression is a regular expression so it may be different each match, in this case it /will/ be different each time. I think Bruce's idea is the better than anything I've come up with. Brett
- Follow-Ups:
- Re: [tlug] grep sort of thing
- From: David Blomberg
- Re: [tlug] grep sort of thing
- From: Stephen Lee
- References:
- Re: [tlug] grep sort of thing
- From: David Blomberg
- Re: [tlug] grep sort of thing
- From: David Blomberg
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] grep sort of thing
- Next by Date: Re: [tlug] grep sort of thing
- Previous by thread: Re: [tlug] grep sort of thing
- Next by thread: Re: [tlug] grep sort of thing
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links