From 6e943a3808e5a11ef7869debac7c1a994790e64e Mon Sep 17 00:00:00 2001 From: Ein Verne Date: Sat, 20 Jun 2020 11:41:03 +0800 Subject: [PATCH] sponge: add page (#4117) --- pages/common/sponge.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pages/common/sponge.md diff --git a/pages/common/sponge.md b/pages/common/sponge.md new file mode 100644 index 000000000..a39770986 --- /dev/null +++ b/pages/common/sponge.md @@ -0,0 +1,12 @@ +# sponge + +> Soak up the input before writing the output file. +> More information: . + +- Append file content to the source file: + +`cat {{path/to/file}} | sponge -a {{path/to/file}}` + +- Remove all lines starting with # in a file: + +`grep -v '^{{#}}' {{path/to/file}} | sponge {{path/to/file}}`