From owner-freebsd-bugs@FreeBSD.ORG Mon Jul 7 18:20:04 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06E931065681 for ; Mon, 7 Jul 2008 18:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E95998FC1F for ; Mon, 7 Jul 2008 18:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m67IK3dE007456 for ; Mon, 7 Jul 2008 18:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m67IK3lR007455; Mon, 7 Jul 2008 18:20:03 GMT (envelope-from gnats) Date: Mon, 7 Jul 2008 18:20:03 GMT Message-Id: <200807071820.m67IK3lR007455@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Wayne Sierke Cc: Subject: Re: bin/125325: Annoying grep(1) bug X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Wayne Sierke List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 18:20:04 -0000 The following reply was made to PR bin/125325; it has been noted by GNATS. From: Wayne Sierke To: Ighighi Cc: bug-followup@freebsd.org Subject: Re: bin/125325: Annoying grep(1) bug Date: Tue, 08 Jul 2008 03:29:16 +0930 On Sun, 2008-07-06 at 04:50 +0000, Ighighi wrote: > > $ env -i /usr/bin/grep --colour=always :0: /etc/passwd > root:*:0:0:Charlie &:/root:/usr/local/bin/bash > toor:*:0:0:Bourne-again Superuser:/root: > > The entire ":0:0:" should be colorized. Note that this is probably to do with pattern-matching rather than colouring: %env -i /usr/bin/grep --only-matching :0: /etc/passwd :0: :0: %/usr/bin/grep --version grep (GNU grep) 2.5.1-FreeBSD ... Testing with ubuntu-8.04.1:  ws@ubuntu:~$ env -i /bin/grep --colour=always :0: /etc/passwd root:x:0:0:root:/root:/bin/bash ws@ubuntu:~$ env -i /bin/grep --only-matching :0: /etc/passwd :0: ws@ubuntu:~$ /bin/grep --version GNU grep 2.5.3 ... (only the first :0: is coloured in the first result). 2.5.3 seems to be the latest version of GNU grep. It's not clear that failing to match overlapped instances of patterns is a bug.