a simple question about grep
Tom Buskey
tom at buskey.name
Fri Sep 7 10:03:13 EDT 2007
On 9/6/07, Kent Johnson <kent37 at tds.net> wrote:
>
> Tom Buskey wrote:
> >
> >
> > On 9/6/07, *G.O.* <gurhan.ozen at gmail.com <mailto:gurhan.ozen at gmail.com>>
> > wrote:
> >
> > egrep "^\*[^INDICATOR]" filename.txt
>
> That excludes lines beginning with * and any of the characters INDCATOR,
> i.e. *N, *D, etc will all be excluded.
>
> > That didn't work for me, but this did:
> >
> > egrep '^\*[^I][^N][^I][^D][^I][^C][^A][^T][^O][^R]' filename.txt
>
> That will exclude a line that matches INDICATOR at any character, for
> example *aN
You're right.
perhaps this:
>
> egrep -P "^\*(?!INDICATOR)" filename.txt
GNU egrep 2.5.1 doesn't work:
$ cat z
*INDICATOR name1 zip1
geoid gender location
*INDICATOR name2 zip2
*geoid gender location
INDICATOR name3 zip3
*district court
$ egrep '^\*(?!INDICATOR)' z
$
No output.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20070907/091bd46f/attachment.html
More information about the gnhlug-discuss
mailing list