Discussion: grep: BRE with caret
Afficher un message
Vieux 21/08/2006, 23h13   #8
johngnub
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: grep: BRE with caret


Chris Mattern wrote:
> Daniel Mentz wrote:
> > On Mon, 21 Aug 2006 14:18:26 -0400, Chris Mattern wrote:
> >
> >
> >>Daniel Mentz wrote:
> >>
> >>>The following command should find all lines containing "xx^x":
> >>>grep "xx^x"
> >>>
> >>>But it doesn't match lines containing "xx^x".

> >
> >
> >>>I'm using grep (GNU grep) 2.5.1
> >>
> >>Using GNU grep 2.5.1:
> >>
> >>syscjm@ayato:~$ grep "xx^x" << EOF
> >> > xxx^
> >> > ^xxxx
> >> > xxaxx^xb
> >> > xx^xstuff
> >> > now is the time
> >> > for all xx^x
> >> > EOF
> >>xxaxx^xb
> >>xx^xstuff
> >>for all xx^x
> >>syscjm@ayato:~$
> >>
> >>
> >>Certainly seems to work fine to me. Perhaps you could be
> >>more specific about your problems.

> >
> >
> > I tried the command you provided on three different machines and I get a
> > different output (no output at all). Would you mind trying it on another
> > machine as well?
> >
> > I also downloaded a vanilla version of GNU grep 2.5.1 and I'm getting the
> > same result.
> >
> > [mentz@baobab src]$ ./grep "xx^x" << EOF
> >
> >>xx^x
> >>EOF

> >
> > [mentz@baobab src]$
> >

>
> My test above was done on a Debian box with a fairly up-to-date Etch
> distribution, using GNU grep 2.5.1 and GNU bash 3.1.14(1)-release.
> A test on a Solaris 10 box with up-to-date patches, using Solaris grep
> (both /usr/bin/grep and /usr/xpg4/bin/grep) and ksh (M-11/16/88i)
> produced the same successful results. At the moment, to me, it looks
> to me like a bug in GNU grep that Debian patched.
>
>
> Chris Mattern


On a Aix 4.3.3 ksh: just FYI,
$ more go
echo "A"
grep "xx^x" << EOF
xxx^
^xxxx
xxaxx^xb
xx^xsstuff
now is the time
for all xx^x
EOF

$
$ ksh go
A
xxaxx^xb
xx^xsstuff
for all xx^x

JB

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