From owner-cvs-all Tue May 7 12:34:17 2002 Delivered-To: cvs-all@freebsd.org Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id 0488F37B40C for ; Tue, 7 May 2002 12:34:03 -0700 (PDT) Received: (qmail 4431 invoked from network); 7 May 2002 19:34:01 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 7 May 2002 19:34:01 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g47JY0F30104; Tue, 7 May 2002 15:34:00 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020507191959.GA26441@FreeBSD.ORG> Date: Tue, 07 May 2002 15:33:53 -0400 (EDT) From: John Baldwin To: "J. Mallett" Subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Cc: Garrett Rooney , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 07-May-2002 J. Mallett wrote: > On Tue, May 07, 2002 at 03:06:37PM -0400, John Baldwin wrote: >> >> On 07-May-2002 J. Mallett wrote: >> > On Tue, May 07, 2002 at 02:39:43PM -0400, Garrett Rooney wrote: >> >> On Tue, May 07, 2002 at 11:32:18AM -0700, J. Mallett wrote: >> >> >> >> > Reviewed by: developers@ (got feedback from: des, fanf, sobomax, >> >> > roberto, >> >> > obrien) >> >> >> >> is there a reason this was posted to developers@, rather than one of >> >> the public mailing lists? it really doesn't seem like an additional >> >> flag for sed is something that needs to be discussed in private. >> > >> > It came up in a discussion, and I felt sorta like I'd been dared to do it, >> > so >> > I replied when I'd done it, and it got a surprisingly good response, so I >> > decided to clean it up, and commit it, once I'd satisfied all of my >> > concerns >> > with it. >> >> It still would have been a good idea to send out the actual patch for review >> on a public list. Personally, I won't use sed -i if it insists on leaving >> backup files around that I have to go the trouble to delete. I might as >> well >> just do sed 'foo' < foo > foo.bak. I only use -i when I'm not specifying a >> backup extension. Those are the only times I use perl in fact, and thus I >> will probably continue to use perl for such things. > > Various points taken. Tell me the preferred way to handle options which may > or may not take arguments, and I'll give it my best shot. I'd assume it's > to do something like You can look at the perl source to see how they do it. :) > And you're also 50% wrong, John. No that is not what you might as well do, > as > it doesn't handle multiple files. Why not? Any competent shell scripter knows how to use a for loop. :) > As for the droppings, what I have in mind to do is just unlink the backup, if > the extension was not given, and to find some good extension to use to reopen > for stdin. I don't think -i should apply if you are working with stdin. I don't think it does for perl. But basically I, for one, just won't have a use for sed -i until it stops leaving droppings. That's all. But please, whatever you do, run your stuff through a public list next time. People accuse *BSD of being closed enough as it is. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message