1 <?xml version=
"1.0" encoding=
"utf-8"?>
5 Copyright © 2006 Joey Hess
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook V4.4//EN"
24 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
31 <firstname>Joey
</firstname>
32 <surname>Hess
</surname>
34 <date>2006-
02-
19</date>
38 <refentrytitle>sponge
</refentrytitle>
39 <manvolnum>1</manvolnum>
40 <refmiscinfo class=
"manual">moreutils
</refmiscinfo>
41 <refmiscinfo class=
"source">moreutils
</refmiscinfo>
45 <refname>sponge
</refname>
46 <refpurpose>soak up standard input and write to a file
</refpurpose>
51 <command>sed '...' file | grep '...' | sponge file
</command>
56 <title>DESCRIPTION
</title>
58 <para><command>sponge
</command> reads standard input and
59 writes it out to the specified file. Unlike a shell
60 redirect, sponge soaks up all its input before
61 opening the output file. This allows constructing
62 pipelines that read from and write to
65 It also creates the output file
66 atomically by renaming a temp file into place,
67 and preserves the permissions of the output file
69 If the output file is a special file or symlink,
70 the data will be written to it.
</para>
71 <para>If no output file is specified, sponge outputs to
79 Colin Watson and Tollef Fog Heen