Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Dec 2017 09:22:20 -0800
From:      Devin Teske <devin@shxd.cx>
To:        Cy Schubert <Cy.Schubert@komquats.com>
Cc:        Hans Petter Selasky <hps@selasky.org>, "rgrimes@freebsd.org" <rgrimes@freebsd.org>, "cem@freebsd.org" <cem@freebsd.org>, Eitan Adler <eadler@freebsd.org>, src-committers <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee
Message-ID:  <F8BD44E8-5055-462C-806D-2F6147B87DB2@shxd.cx>
In-Reply-To: <20171205162926.9F16C1DD@spqr.komquats.com>
References:  <20171205162926.9F16C1DD@spqr.komquats.com>

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

> On Dec 5, 2017, at 8:29 AM, Cy Schubert <Cy.Schubert@komquats.com> wrote:
>=20
> Why not update sed to create the backup file only if the suffix is given t=
o -i, like gnu sed does.
>=20

I suspect that would break countless scripts that test uname to determine ho=
w to use the -i flag of sed.
--=20
Devin


> ---
> Sent using a tiny phone keyboard.
> Apologies for any typos and autocorrect.
> This old phone only supports top post. Apologies.
>=20
> Cy Schubert
> <Cy.Schubert@cschubert.com> or <cy@freebsd.org>
> The need of the many outweighs the greed of the few.
> ---
> From: Devin Teske
> Sent: 05/12/2017 07:35
> To: Hans Petter Selasky
> Cc: rgrimes@freebsd.org; cem@freebsd.org; Eitan Adler; src-committers; svn=
-src-all@freebsd.org; svn-src-head@freebsd.org
> Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/spong=
e/tests usr.bin/tee
>=20
>=20
> > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky <hps@selasky.org> wrote:=

> >=20
> >> On 12/05/17 13:58, Rodney W. Grimes wrote:
> >> Further more, why does freebsd need this in base?
> >=20
> > Hi,
> >=20
> > I think this is useful. It could replace the "-i " (intermediate) option=
 for "sed" for example. It avoids creating temporary files when filtering fi=
les, right?
> >=20
> > --HPS
> >=20
>=20
> Wth is wrong with:
>=20
> data=3D$( sed -e '...' somefile ) &&
>         echo "$data" > somefile
>=20
> or
>=20
> set -e
> data=3D...
> echo "$data" > ...
>=20
> or
>=20
> exec 3<<EOF
> $( ... )
> EOF
> cat > ... <&3
>=20
> or
>=20
> (I digress)
>=20
> Infinite variations, but the gist is that sponge looks to be trying to hel=
p sh(1)/similar when help is unneeded.
>=20
> Why buffer data into memory via fork-exec-pipe to sponge when you can buff=
er to native namespace without pipe to sponge?
>=20
> Am I missing something? Why do we need sponge(1)?
> --=20
> Devin
>=20



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F8BD44E8-5055-462C-806D-2F6147B87DB2>