Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 May 2002 15:33:53 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        "J. Mallett" <jmallett@FreeBSD.ORG>
Cc:        Garrett Rooney <rooneg@electricjellyfish.net>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/sed main.c sed.1
Message-ID:  <XFMail.20020507153353.jhb@FreeBSD.org>
In-Reply-To: <20020507191959.GA26441@FreeBSD.ORG>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <jhb@FreeBSD.org>  <><  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020507153353.jhb>