From owner-svn-src-head@freebsd.org Tue Dec 5 15:53:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB05E6E93C; Tue, 5 Dec 2017 15:53:51 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-wr0-x22f.google.com (mail-wr0-x22f.google.com [IPv6:2a00:1450:400c:c0c::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02BDB7FFE2; Tue, 5 Dec 2017 15:53:51 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-wr0-x22f.google.com with SMTP id z34so794006wrz.10; Tue, 05 Dec 2017 07:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=upZrzz+2yP+DM/uhrJ9OUEk2NiHB4yGJSHdXaTRTChA=; b=aPfKR9Cd72Tp08W7xem3Zh6eG82orifhKdJ4XkB9VfHxJ1X5/u+oSDoO9mn1J1ZPH3 WHaUQpbjGFAf6cf8mM9nKp17wlHpKMyw4trv5pud3quS+gUuB86VNOziqdG5nK1WqVrT UeVBrv0oVf3G4J+C5WWW1Y3dHGh6PH3a3tOM1uI3Q0Y4k0G0AA+nKviGA5MS1fUEW5Zw +3K7YlFT4mZLWFe+hvzmZy4uniQwrhdy3MyFSWk0eMAleTkhWKTJq8B8uFt+oZ+E6jQi /mHqh9EJZvpkjjHpLCm4hcdx+WF+6BX51qTZCVUguCB/VJ6xT8PUtfyLkpfrKLOo5QbG dbDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=upZrzz+2yP+DM/uhrJ9OUEk2NiHB4yGJSHdXaTRTChA=; b=nd3aWG7tdrW38osnd3ZELVnbnmB8JW4FvM9xvzRAWPFxrQEcwkoczwFKOdDo9PnlIq JmINwO1Vs6YcBa/dL+5OO5qCeJPOuj7/cy9YLhXrc1UCuiuLhs0RZCW+Y+LO9MrzDjNq MlB2D0JmC+BSaf9PfmXjyqLpgP8SAwNgjs13MusykokmfHOFe+6AheClQ8Bsdzm4Ed8x H8AaMREdqEzZ/DwuBRTo4YDDgdAhI3vB42r29QH6FmZ3P5hYtfpUP/qYAcL0SSBITaKd kYzRecaBkWLB508+6M7yIGfH2Trj1tFwSb7BoUwpkhHqFX+jKEKEQcPK/6TITsa+QWGy IOqg== X-Gm-Message-State: AJaThX655N4YakjVVBnh+aqIrL29N5jgZcNY3+ilCbo2+PEewVd8NmBA J/bGGrBE4bNrnwfkxnv69EiN9FHC9TBTwZTSXaogYg== X-Google-Smtp-Source: AGs4zMYqRTdZKPkZzIICqHV1urZKz4w1BeNeL/y/akm668MUaq3FYcHYTmTsq3QEIDqRcXkREYJvuqlxJpifDq7BKCU= X-Received: by 10.223.134.134 with SMTP id 6mr16598328wrx.72.1512489228838; Tue, 05 Dec 2017 07:53:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.196.9 with HTTP; Tue, 5 Dec 2017 07:53:48 -0800 (PST) Received: by 10.223.196.9 with HTTP; Tue, 5 Dec 2017 07:53:48 -0800 (PST) In-Reply-To: References: <201712051258.vB5CwjQN051356@pdx.rh.CN85.dnsmgr.net> <22918eec-4c98-01e4-4c63-e145fbc6eab9@selasky.org> From: Matt Joras Date: Tue, 5 Dec 2017 07:53:48 -0800 Message-ID: Subject: Re: svn commit: r326554 - in head: . usr.bin/sponge usr.bin/sponge/tests usr.bin/tee To: Devin Teske Cc: Hans Petter Selasky , rgrimes@freebsd.org, cem@freebsd.org, Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2017 15:53:51 -0000 On Dec 5, 2017 7:35 AM, "Devin Teske" wrote: > On Dec 5, 2017, at 5:00 AM, Hans Petter Selasky wrote: > >> On 12/05/17 13:58, Rodney W. Grimes wrote: >> Further more, why does freebsd need this in base? > > Hi, > > I think this is useful. It could replace the "-i " (intermediate) option for "sed" for example. It avoids creating temporary files when filtering files, right? > > --HPS > Wth is wrong with: data=$( sed -e '...' somefile ) && echo "$data" > somefile or set -e data=... echo "$data" > ... or exec 3< ... <&3 or (I digress) Infinite variations, but the gist is that sponge looks to be trying to help sh(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)? -- Devin I do believe you are sort of missing the point. It is a utility that is explicitly useful in shell pipelines, so when you want to do things as one-liners. I like the utility and use the one from ports and my own version in various things here and there. It is a common utility installed in Linux distros and the top answer on Google for questions such as "redirect shell output to same file". I think the outrage about adding a tiny utility that's common elsewhere is a bit silly. As for the implementation, I have my own version of sponge (hobby program written in rust so not base-worthy), and it uses explicit temporary files for larger outputs. Matt