sponge

module
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2025 License: MIT

README

sponge

GitHub Releases LICENSE CI Go Reference Go Report Card

Go implementation of moreutils's sponge(1) command.

Usage

$ sponge --help
Usage: sponge [-ar] [[-o] FILE]
       sponge [-ar] [[-o] FILE] -- COMMAND [ARGS...]

sponge reads the standard input and writes it to the specified file.
Unlike shell redirects, sponge reads all input before writing output.
This allows to build a pipeline that reads from and writes to the same file.

If FILE is omitted, sponge will write to the standard output.

If COMMAND is specified, the command is executed, and only if it terminates
successfully, its output is written to FILE.

Options:
  -a, --append          Append to FILE instead of overwriting it
  -r, --replace         Replace FILE atomically instead of overwriting it
  -o, --output=FILE     Write output to FILE
  -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

Directories

Path Synopsis
cmd
sponge command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL