From owner-cvs-all Thu May 9 9:19:59 2002 Delivered-To: cvs-all@freebsd.org Received: from espresso.q9media.com (espresso.q9media.com [216.254.138.122]) by hub.freebsd.org (Postfix) with ESMTP id A082B37B404; Thu, 9 May 2002 09:19:52 -0700 (PDT) Received: (from mike@localhost) by espresso.q9media.com (8.11.6/8.11.6) id g49GIgH24456; Thu, 9 May 2002 12:18:42 -0400 (EDT) (envelope-from mike) Date: Thu, 9 May 2002 12:18:42 -0400 From: Mike Barcroft To: "Crist J. Clark" Cc: Tony Finch , Alfred Perlstein , John Baldwin , "J. Mallett" , Garrett Rooney , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/sed main.c sed.1 Message-ID: <20020509121842.A22234@espresso.q9media.com> References: <20020507191959.GA26441@FreeBSD.ORG> <20020507205541.GL36741@elvis.mu.org> <20020507221134.A26336@chiark.greenend.org.uk> <20020508125316.F94469@blossom.cjclark.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020508125316.F94469@blossom.cjclark.org>; from cjc@FreeBSD.org on Wed, May 08, 2002 at 12:53:16PM -0700 Organization: The FreeBSD Project 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 Crist J. Clark writes: > Well, since everyone else seems to have an opinion as to the color of > the sed(1) shed... > > I think sed(1) is the wrong tool for this. We already have a tool that > does "inline" editing, ed(1), > > $ ed somefile.txt < ,s/blah/blee/ > wq > EOF > > IMHO, it would be much more logical to add an '-i' option to ed(1) and > an '-e' option for command line ed commands, > > $ ed -i old -e ',s/blah/blee/' somefile.txt > > (And the 'wq' are implied by the usage). A lot of the other issues > (handling file operations) are already dealt with in ed(1). I prefer cp(1) for copying files, but I think the -e part is good a idea. For now, ports can just use: `(echo ",s/foo/bar/" ; echo "wq") | ed baz.txt' ...to do search and replace. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message