From owner-freebsd-ports@FreeBSD.ORG Mon Aug 4 20:32:10 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 E0852106567B; Mon, 4 Aug 2008 20:32:10 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by mx1.freebsd.org (Postfix) with ESMTP id C5CA48FC20; Mon, 4 Aug 2008 20:32:10 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from relay12.apple.com (relay12.apple.com [17.128.113.53]) by mail-out4.apple.com (Postfix) with ESMTP id 54AB736DC6AC; Mon, 4 Aug 2008 13:32:05 -0700 (PDT) Received: from relay12.apple.com (unknown [127.0.0.1]) by relay12.apple.com (Symantec Mail Security) with ESMTP id E6E4946404B; Mon, 4 Aug 2008 13:32:04 -0700 (PDT) X-AuditID: 11807135-a7df5bb000001321-dc-48976744698d Received: from cswiger1.apple.com (cswiger1.apple.com [17.227.140.124]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by relay12.apple.com (Apple SCV relay) with ESMTP id CA488420003; Mon, 4 Aug 2008 13:32:04 -0700 (PDT) Message-Id: From: Chuck Swiger To: Andrey Chernov In-Reply-To: <20080804201806.GA50143@nagual.pp.ru> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v928.1) Date: Mon, 4 Aug 2008 13:32:04 -0700 References: <56E45E0F-29D4-4CA8-9936-384405AB874A@mac.com> <4897518D.4090001@FreeBSD.org> <20080804201806.GA50143@nagual.pp.ru> X-Mailer: Apple Mail (2.928.1) X-Brightmail-Tracker: AAAAAA== Cc: G?bor K?vesd?n , FreeBSD Ports Subject: Re: bsd-grep-20080725_1 -v flag busted... X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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:32:11 -0000 On Aug 4, 2008, at 1:18 PM, Andrey Chernov wrote: >> echo 'fee\nfi\nfoe\nfum' | ./grep -v fi >> echo 'fee\nfi\nfoe\nfum' | /usr/bin/grep -v fi > > Example is broken, echo (for sh) supposed to be > > echo 'fee > fi > foe > fum' | ... Well, if your shell's built-in echo doesn't grok newlines, then /usr/ bin/printf works, as Daniel suggested. But using /bin/sh and a multiline statement as you suggest shows the exact same problem: % echo 'fee > fi > foe > fum' | ./grep -v fi % echo 'fee > fi > foe > fum' | /usr/bin/grep -v fi fee foe fum (I'm much more interested in confirming whether the bug I see in BSD grep is reproducible by others than debating how to get real newlines from various shells.) -- -Chuck