From owner-freebsd-ports@FreeBSD.ORG Mon Aug 4 20:37:44 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF3CC106564A for ; Mon, 4 Aug 2008 20:37:44 +0000 (UTC) (envelope-from prvs=pschmehl_lists=09551e61c@tx.rr.com) Received: from ip-relay-002.utdallas.edu (ip-relay-002.utdallas.edu [129.110.20.112]) by mx1.freebsd.org (Postfix) with ESMTP id 8F4A18FC24 for ; Mon, 4 Aug 2008 20:37:44 +0000 (UTC) (envelope-from prvs=pschmehl_lists=09551e61c@tx.rr.com) X-Group: RELAYLIST X-IronPort-AV: E=Sophos;i="4.31,306,1215406800"; d="scan'208";a="4766552" Received: from smtp3.utdallas.edu ([129.110.20.110]) by ip-relay-002.utdallas.edu with ESMTP; 04 Aug 2008 15:34:20 -0500 Received: from utd65257.utdallas.edu (utd65257.utdallas.edu [129.110.3.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTPSA id D25BD23DEA for ; Mon, 4 Aug 2008 15:34:20 -0500 (CDT) Date: Mon, 04 Aug 2008 15:34:21 -0500 From: Paul Schmehl To: FreeBSD Ports Message-ID: <2BCBD61840E51EB3A2C57E26@utd65257.utdallas.edu> In-Reply-To: <20080804202421.GA29719@hobbes.ustdmz.roe.ch> References: <56E45E0F-29D4-4CA8-9936-384405AB874A@mac.com> <4897518D.4090001@FreeBSD.org> <20080804202421.GA29719@hobbes.ustdmz.roe.ch> X-Mailer: Mulberry/4.0.6 (Linux/x86) X-Munged-Reply-To: Figure it out MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: bsd-grep-20080725_1 -v flag busted... X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Paul Schmehl List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2008 20:37:44 -0000 --On Monday, August 04, 2008 22:24:21 +0200 Daniel Roethlisberger=20 wrote: > G=C3=A1bor K=C3=B6vesd=C3=A1n 2008-08-04: >> Chuck Swiger escribi=C3=B3: >> > I'd just updated the BSD grep port to bsd-grep-20080725_1, but >> > regrettably have noticed that many things using grep stopped working. >> > For example, running GNU-style ./configure hangs here: >> > >> > configure: creating ./config.status >> > load: 1.15 cmd: sh 72964 [runnable] 7.60u 95.78s 14% 2260k >> > >> > A trivial test case: >> > >> > % echo 'fee\nfi\nfoe\nfum' | ./grep -v fi >> > % echo 'fee\nfi\nfoe\nfum' | /usr/bin/grep -v fi >> > fee >> > foe >> > fum >> > % ./grep --version >> > grep (BSD grep) 2.5.1-FreeBSD >> Hello Chuck, >> >> thanks for your notes. It seems very strange to me, because GNU grep >> produces the same output for me. Apart from this, the -v flag was really >> broken, but I applied some fixes before updating the port and in the >> version, which I committer, I thought that the -v flag was compatible. >> >> Here is what I get at the moment: >> >> > echo 'fee\nfi\nfoe\nfum' | ./grep -v fi >> > echo 'fee\nfi\nfoe\nfum' | /usr/bin/grep -v fi >> > /usr/bin/grep -V >> grep (GNU grep) 2.5.1-FreeBSD >> >> Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. >> This is free software; see the source for copying conditions. There is NO >> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. >> >> >> It's still the same, thus I don't understand how you could produce that >> output with GNU grep. > > I may be stating the obvious, but note that depending on your shell and > it's configuration, echo might not translate \n to an actual newline. > You might need to use `echo -e' instead of `echo' to get four lines > printed instead of one. /bin/sh and bash need it, ksh doesn't, not sure > about (t)csh. Also note that our /bin/echo doesn't know about -e and > will never translate \n to a newline. The following should be more > portable across different shells: > > printf 'fee\nfi\nfoe\nfum' | ./grep -v fi > printf 'fee\nfi\nfoe\nfum' | /usr/bin/grep -v fi Indeed: pauls@utd65257# echo -e 'fee\nfi\nfoe\nfum' fee fi foe fum pauls@utd65257# echo -e 'fee\nfi\nfoe\nfum' | grep -v fi fee foe fum --=20 Paul Schmehl, Senior Infosec Analyst As if it wasn't already obvious, my opinions are my own and not those of my employer. ******************************************* Check the headers before clicking on Reply.