From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 29 08:59:34 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6492D16A405 for ; Thu, 29 Mar 2007 08:59:34 +0000 (UTC) (envelope-from dds@aueb.gr) Received: from mx-out-04.forthnet.gr (mx-out.forthnet.gr [193.92.150.103]) by mx1.freebsd.org (Postfix) with ESMTP id C1CCD13C469 for ; Thu, 29 Mar 2007 08:59:33 +0000 (UTC) (envelope-from dds@aueb.gr) Received: from mx-av-04.forthnet.gr (mx-av.forthnet.gr [193.92.150.27]) by mx-out-04.forthnet.gr (8.13.8/8.13.8) with ESMTP id l2T8JwV0030644; Thu, 29 Mar 2007 11:19:58 +0300 Received: from MX-IN-02.forthnet.gr (mx-in-02.forthnet.gr [193.92.150.185]) by mx-av-04.forthnet.gr (8.13.7/8.13.7) with ESMTP id l2T8JwbA016288; Thu, 29 Mar 2007 11:19:58 +0300 Received: from [192.168.136.22] (ppp121-127.adsl.forthnet.gr [193.92.228.127]) by MX-IN-02.forthnet.gr (8.14.0/8.14.0) with ESMTP id l2T8Jueu025762; Thu, 29 Mar 2007 11:19:57 +0300 Authentication-Results: MX-IN-02.forthnet.gr from=dds@aueb.gr; sender-id=neutral; spf=neutral Message-ID: <460B76A0.5030200@aueb.gr> Date: Thu, 29 Mar 2007 11:19:44 +0300 From: Diomidis Spinellis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061211 SeaMonkey/1.0.7 MIME-Version: 1.0 To: Yar Tikhiy References: <20070326135106.GG60831@comp.chem.msu.su> In-Reply-To: <20070326135106.GG60831@comp.chem.msu.su> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: sed -i X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2007 08:59:34 -0000 Yar Tikhiy wrote: > Hi, > > Recently noticed that our sed(1) differs from its GNU analog in > that in -i mode it considers all files as a single sequence of lines > while the latter treats each file independently. The in-line mode > isn't in POSIX, so it isn't really clear which way is correct. > > Here is a couple of practical consequences: > > - our sed won't act on a numeric range of lines in each file, > as in: sed -i '' 2,5d *, which may be counter-intuitive. > - our sed's line ranges can span file boundaries in -i mode. > > If the second feature isn't important, I think we should use > a separate line space for each file edited in-line, which is > usually desired. > > Comments? > > P.S. Attached are a test script and outputs from it for our > sed and GNU sed as found in a Linux I have access to. > I believe the GNU interpretation of lines in -i makes sense. Diomidis - dds@