grep: match i to j occurences of abc
From: Penna Elabi (terebinthus_at_go.com)
Date: 08/30/03
- Next message: Kurt J. Lanza: "Re: Remove <CR> across HTML files"
- Previous message: Juha Laiho: "Re: RCS ci -m"
- Next in thread: Kurt J. Lanza: "Re: grep: match i to j occurences of abc"
- Reply: Kurt J. Lanza: "Re: grep: match i to j occurences of abc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Aug 2003 10:50:31 -0700
I have file test:
abc
abc abc abc
abc abc abc abc
How do I print with grep lines where abc occurs at least 3 times but
no more than 4 times (i.e. second and third line):
abc abc abc
abc abc abc abc
I have read man grep, and it says:
\{i,j\}
matches any number of occurrences of the character matched by
the BRE from i to j, inclusive.
So, I tried these:
grep abc\{3,5\} test
grep 'abc\{3,5\}' test
grep 'abc'\{3,5\} test
But they don't work.
- Next message: Kurt J. Lanza: "Re: Remove <CR> across HTML files"
- Previous message: Juha Laiho: "Re: RCS ci -m"
- Next in thread: Kurt J. Lanza: "Re: grep: match i to j occurences of abc"
- Reply: Kurt J. Lanza: "Re: grep: match i to j occurences of abc"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]