From: Mateusz_madi on
I wan't to show all lines from file which consist of only 3 char:
grep ^.{3}$ file
Why this does't work?? Isn't it the same as :
grep ^...$ file ??

madi
From: Ike Naar on
In article <a7b3d37e-d60c-42ac-aa96-c88c1c53e2f4(a)q13g2000vbm.googlegroups.com>,
Mateusz_madi <madi.czadi(a)gmail.com> wrote:
>I wan't to show all lines from file which consist of only 3 char:
>grep ^.{3}$ file
>Why this does't work?? Isn't it the same as :
>grep ^...$ file ??

grep '^.\{3\}$'

From: Mateusz_madi on
Thanks Ike Naar >>>
From: Marc on
Mateusz_madi wrote:

> I wan't to show all lines from file which consist of only 3 char:
> grep ^.{3}$ file
> Why this does't work?? Isn't it the same as :
> grep ^...$ file ??

grep -E "^.{3}$" file
seems to work better (or egrep). Or use \{ and \}.
From: Mateusz_madi on
Hmm so you have used -E option, an ^.{3}$ works fine! which mean
extended grep what is the difference between extended and normal one?