[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BUG: grep --color -i
From: |
Kenneth Nellis |
Subject: |
BUG: grep --color -i |
Date: |
Thu, 25 May 2006 10:38:38 -0400 |
To Whom It May Concern:
(This e-mail contains color-coded text.)
I wish to report that grep does not correctly color matched strings.
Below, I offer commands and their output to demonstrate that “grep --color -i”
misses some of the strings it should highlight. In the output, below, the bold
red highlighting was provided by grep. I added the background highlighting to
point out strings that grep failed to highlight.
1 $ uname -a
2 Linux unxcvs 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:28:55 EDT 2005 i686
i686 i386 GNU/Linux
3 $ which grep
4 /bin/grep
5 $ alias grep
6 alias grep='grep --color'
7 $ grep --version > f
8 $ cat f
9 grep (GNU grep) 2.5.1
10
11 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
12 This is free software; see the source for copying conditions. There is
NO
13 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
14
15 $ echo -e "copy\nfree" > pat
16 $ cat pat
17 copy
18 free
19 $ grep -i -f pat f
20 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
21 This is free software; see the source for copying conditions. There is
NO
22 $ echo -e "free\ncopy" > pat2
23 $ cat pat2
24 free
25 copy
26 $ grep -i -f pat2 f
27 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
28 This is free software; see the source for copying conditions. There is
NO
29 $
Specifically, in line 21, grep should have highlighted “free” and in line 27,
it should have highlighted “Copy” (of “Copyright”).
—Ken Nellis
- BUG: grep --color -i,
Kenneth Nellis <=