help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

{repeat count} in grep 2.5.1 vs grep 2.4.2


From: Brenda J. Butler
Subject: {repeat count} in grep 2.5.1 vs grep 2.4.2
Date: Mon, 24 Mar 2003 23:26:21 -0500
User-agent: Mutt/1.3.28i


I've seen some odd behaviour with grep 2.5.1.
(I was running grep 2.5.1 on RedHat 8.0, bash 2.05.1(b);
grep 2.4.2 on RedHat 7.2, bash 2.08.1 and other upgrades
of particular packages).  (version numbers from memory,
all are accurate except maybe the ends of the bash ones)

In preparing answers to exercises for students, I found that grep 2.5.1
had trouble with the following (failed to find anything)
while grep 2.4.2 found the expected lines (same input, from ps aux
captured to file):

The exercise is to get the students to look through the ps aux
output to find lines with certain strings in the 11th field
(the process name):

ps aux | egrep "^([^ ]+[ ]+){10}.*bash"

fails to find anything (returns 1), while

ps aux | egrep "^([^ ]+[ ]+)+.*bash"

finds a few lines for bash and returns 0.

The first line returns the same output as the second in
in grep 2.4.2.

I'm not a guru or anything, so I'm sending this to the help
list first in case it's my mistake; if no one instructs
me otherwise I will send it to bug-gnu-utils in a day or two.

Another person tried this on grep 2.5f and it worked properly
for him.

If you need more info, tell me what you need.  I won't read
your answer till tomorrow night, will answer the following night.

------

I downloaded the source to grep 2.5.1 and tried to adjust
the test scripts to run the native grep on the machine
(just changed GREP= to GREP=/bin/grep).  It seemed to pass
most tests.  I see there were some various tests using those
explicit repeat counts, maybe they have been a problem in
the past?  Then I wanted to use the spencer1 and spencer2
tests, and did a little more futzing, maybe I got it right
and maybe not.  Then I really wasn't sure how to add
the above test.  Oh well, I tried.  I'd send you the
efforts but they're at work and I'm at home just now.

Thanks for listening.

-- 
bjb
Welcome to the GNU age!   http://www.gnu.org
5F82 9855 E247 1F8A 49CD  053E FB03 E77F 2A19 D707




reply via email to

[Prev in Thread] Current Thread [Next in Thread]