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

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

grep adds extra characters between groups of matches


From: Kurt Schwehr
Subject: grep adds extra characters between groups of matches
Date: Wed, 29 Aug 2001 14:28:22 -0700

I don't know if this is a bug or not.  If not, it could use a little
comment in the info page to the extent that grep adds a "--" between
groups of matches.  Seems reasonable, just it's not doc'ed.  Here is an
example of the input and result.

INPUT
-----


as1a2 110 45.0 0 0
2.290500E+2 2.320500E+2 2.242500E+2 2.284500E+2 2.306500E+2
2.318500E+2 2.320500E+2 2.358500E+2 2.318500E+2 2.320500E+2
2.174500E+2 2.340500E+2 2.290500E+2 2.174500E+2 2.342500E+2
as1a3 110 45.0 0 0
2.346500E+2 2.374500E+2 2.292500E+2 2.346500E+2 2.374500E+2
2.380500E+2 2.382500E+2 2.424500E+2 2.382500E+2 2.384500E+2
2.234500E+2 2.412500E+2 2.336500E+2 2.234500E+2 2.410500E+2
as3a1 50 26.0 0 0
2.062500E+2 2.072500E+2 2.024500E+2 2.054500E+2 2.068500E+2
2.102500E+2 2.088500E+2 2.106500E+2 2.106500E+2 2.090500E+2
2.084500E+2 2.010500E+2 2.086500E+2 2.094500E+2 2.014500E+2
as3a2 50 26.0 0 0
2.146500E+2 2.180500E+2 2.118500E+2 2.146500E+2 2.172500E+2
2.194500E+2 2.182500E+2 2.198500E+2 2.202500E+2 2.182500E+2
2.112500E+2 2.186500E+2 2.186500E+2 2.114500E+2 2.184500E+2
as3a3 50 26.0 0 0
1.884500E+2 1.902500E+2 1.858500E+2 1.878500E+2 1.896500E+2
1.920500E+2 1.908500E+2 1.922500E+2 1.926500E+2 1.908500E+2
1.850500E+2 1.912500E+2 1.904500E+2 1.846500E+2 1.910500E+2
as1b1 120 51.0 0 0
2.419000E+2 2.437000E+2 2.383000E+2 2.415000E+2 2.427000E+2
2.417000E+2 2.415000E+2 2.463000E+2 2.417000E+2 2.421000E+2
2.295000E+2 2.463000E+2 2.379000E+2 2.301000E+2 2.461000E+2
as1b2 120 51.0 0 0
2.303000E+2 2.333000E+2 2.281000E+2 2.307000E+2 2.327000E+2
2.319000E+2 2.307000E+2 2.353000E+2 2.317000E+2 2.309000E+2
2.197000E+2 2.359000E+2 2.267000E+2 2.197000E+2 2.355000E+2

COMMAND
-------
grep -A 3 as1 data

OUTPUT (notice the "--" in the middle)
------

as1a1 110 45.0 0 0
2.486000E+2 2.534000E+2 2.438000E+2 2.490000E+2 2.534000E+2
2.538000E+2 2.542000E+2 2.578000E+2 2.542000E+2 2.540000E+2
2.362000E+2 2.564000E+2 2.498000E+2 2.360000E+2 2.574000E+2
as1a2 110 45.0 0 0
2.290500E+2 2.320500E+2 2.242500E+2 2.284500E+2 2.306500E+2
2.318500E+2 2.320500E+2 2.358500E+2 2.318500E+2 2.320500E+2
2.174500E+2 2.340500E+2 2.290500E+2 2.174500E+2 2.342500E+2
as1a3 110 45.0 0 0
2.346500E+2 2.374500E+2 2.292500E+2 2.346500E+2 2.374500E+2
2.380500E+2 2.382500E+2 2.424500E+2 2.382500E+2 2.384500E+2
2.234500E+2 2.412500E+2 2.336500E+2 2.234500E+2 2.410500E+2
--
as1b1 120 51.0 0 0
2.419000E+2 2.437000E+2 2.383000E+2 2.415000E+2 2.427000E+2
2.417000E+2 2.415000E+2 2.463000E+2 2.417000E+2 2.421000E+2
2.295000E+2 2.463000E+2 2.379000E+2 2.301000E+2 2.461000E+2
as1b2 120 51.0 0 0
2.303000E+2 2.333000E+2 2.281000E+2 2.307000E+2 2.327000E+2
2.319000E+2 2.307000E+2 2.353000E+2 2.317000E+2 2.309000E+2
2.197000E+2 2.359000E+2 2.267000E+2 2.197000E+2 2.355000E+2

SYSTEM INFO:
------------
Mandrake 8.0 x86 distribution

uname -a
Linux mars.schwehr.org 2.4.3-20mdk #1 Sun Apr 15 23:03:10 CEST 2001 i686
unknown

grep --version
grep (GNU grep) 2.4.2

rpm -q grep
grep-2.4.2-6mdk


Thanks!
-kurt

-- 
Kurt Schwehr         -- SIO grad student   -- http://schwehr.org/
Office: 858-822-4879 -- address@hidden -- address@hidden



reply via email to

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