Skip to content

hymkor/sponge

Repository files navigation

sponge (clone)

soak up standard input and write to a file. (original version, my Rust version)

$ cat foo.txt
a
b
c
d
$ cat -n foo.txt | sponge foo.txt
$ cat foo.txt
     1 a
     2 b
     3 c
     4 d

(Japanese: 標準入力を全て読み取ってから、その内容を引数のファイルに出力します)

Install

Download the binary package from Releases and extract the executable.

Use "go install"

go install github.com/hymkor/sponge@latest

Use "scoop-installer"

scoop install https://raw.githubusercontent.com/hymkor/sponge/master/sponge.json

or

scoop bucket add hymkor https://github.com/hymkor/scoop-bucket
scoop install sponge

Usage

sponge {options} {FILENAME(s)...}

  • -b string
    • Postfix for backup of original files
  • -v
    • Output log to the standard error
  • -h
    • Show this help

Release Note(English) Release Note(Japanese)