Hi!
As written in my question at the end, I asked about a strange behavior of
grep -w.
I got several answers, most of them stating that they had same experience in
various versions of Tru64 v4.x, from 4.0D to 4.0G patchkit 2.
One stated it worked OK in Tru64 4.0F patchkit 5, but 2 other said the
opposite.
Octave Orgeron appeared to have in-depth knowledge about the issue and gave
me this answer :
Hi Jesper,
You are correct about the function of grep under 4.x vs. 5.x. What happened
here, is that the XPG compliant grep is the default in 5.x, so the behavior
is different. The same thing happened in Solaris 7, which is why it acts
like 5.x. I believe that in order to get the same behavior in 4.x you have
to use the SV4 utils which are on the Associated Products cd. For the
vast majority of Unix's, they are all going through the process of changing
their compliantness from SV4 or BSD to the Posix XPG standards. Which is
good in the long run of things. In Tru64, you'll notice that since 5.x came
out, there are more SV4'isms about the commands and the devices, which
conforms to the XPG standards if I remember correctly. So all in all, it's
a good thing:)
I'll check out the SV4 version and consider using this instead. Another
possible solution is to use grep -x, but I'm not sure this will be accepted
by the people using it since they prefer to use same syntax across Solaris &
Tru64 in their scripts.
I think I'll probably also open a support case at CPQ, since the man page
description according to my (limited) english knowledge is wrong. What it
describes is the functionality found in v5.x, not the functionality found in
v4.x.
/Jesper
> -----Original Message-----
> From: Nemholt, Jesper Frank
> Sent: miércoles, 20 de junio de 2001 1:15
> To: tru64-unix-managers_at_ornl.gov
> Subject: grep -w bug in 4.x but not in 5.x
>
>
> Hi!
>
> Make a file (test.txt) containing :
>
> 3
> 33
> 333
> 3333
>
>
> Then do a :
>
> cat test.txt | grep -w 3
>
>
> On 4.0F patchkit 4 and 4.0D patchkit something, grep returns
> all lines.
> On 5.1 patchkit 3 grep returns only the first line. The same
> happens on
> Solaris 7.
>
> I believe grep -w in 5.1 and Solaris 7 is behaving correct
> according to the
> man description, and wrong on 4.x.
>
>
> Fixed in any patch, or ?
>
>
> /Jesper
>
Received on Wed Jun 20 2001 - 18:30:54 NZST