Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Dec 2017 07:33:21 -0800
From:      Devin Teske <devin@shxd.cx>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        rgrimes@freebsd.org, cem@freebsd.org, Eitan Adler <eadler@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@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:  <AE022237-A2D5-49E1-A6DA-DD65A460B266@shxd.cx>
In-Reply-To: <22918eec-4c98-01e4-4c63-e145fbc6eab9@selasky.org>
References:  <201712051258.vB5CwjQN051356@pdx.rh.CN85.dnsmgr.net> <22918eec-4c98-01e4-4c63-e145fbc6eab9@selasky.org>

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

> 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 f=
or "sed" for example. It avoids creating temporary files when filtering file=
s, right?
>=20
> --HPS
>=20

Wth is wrong with:

data=3D$( sed -e '...' somefile ) &&
        echo "$data" > somefile

or

set -e
data=3D...
echo "$data" > ...

or

exec 3<<EOF
$( ... )
EOF
cat > ... <&3

or

(I digress)

Infinite variations, but the gist is that sponge looks to be trying to help s=
h(1)/similar when help is unneeded.

Why buffer data into memory via fork-exec-pipe to sponge when you can buffer=
 to native namespace without pipe to sponge?

Am I missing something? Why do we need sponge(1)?
--=20
Devin=




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AE022237-A2D5-49E1-A6DA-DD65A460B266>