sponge

Go implementation of moreutils's sponge(1) command.
Usage
$ sponge --help
Usage: sponge [-ar] [FILE]
sponge reads the standard input and writes it to the specified file.
Unlike shell redirects, sponge reads all input before writing output.
This allows building a pipeline that reads from and writes to the same file.
If FILE is omitted, sponge outputs to the standard out.
Options:
-a, --append Append to FILE instead of overwriting it
-r, --replace Replace FILE atomically instead of overwriting it
-h, --help Show this help message and exit
--version Show version information and exit
Installation
Download from GitHub Releases
Build from source
$ go install github.com/cions/sponge/cmd/sponge@latest
License
MIT