Date: Wed, 8 May 2002 12:53:16 -0700 From: "Crist J. Clark" <cjc@FreeBSD.org> To: Tony Finch <dot@dotat.at> Cc: Alfred Perlstein <bright@mu.org>, John Baldwin <jhb@FreeBSD.org>, "J. Mallett" <jmallett@FreeBSD.org>, 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: <20020508125316.F94469@blossom.cjclark.org> In-Reply-To: <20020507221134.A26336@chiark.greenend.org.uk>; from dot@dotat.at on Tue, May 07, 2002 at 10:11:34PM %2B0100 References: <20020507191959.GA26441@FreeBSD.ORG> <XFMail.20020507153353.jhb@FreeBSD.org> <20020507205541.GL36741@elvis.mu.org> <20020507221134.A26336@chiark.greenend.org.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 07, 2002 at 10:11:34PM +0100, Tony Finch wrote:
> On Tue, May 07, 2002 at 01:55:41PM -0700, Alfred Perlstein wrote:
> >
> > Just open and then unlink the source file then recreate it as the
> > output file.
>
> That's no good if there's a failure, e.g. disk full.
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 <<EOF
,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).
--
Crist J. Clark | cjclark@alum.mit.edu
| cjclark@jhu.edu
http://people.freebsd.org/~cjc/ | cjc@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?20020508125316.F94469>
