2025-03-14 21:59:59 -06:00
|
|
|
# sponge
|
|
|
|
|
|
|
|
|
|
> Soak up the input before writing the output file.
|
|
|
|
|
> More information: <https://manned.org/sponge>.
|
|
|
|
|
|
|
|
|
|
- Append file content to the source file:
|
|
|
|
|
|
|
|
|
|
`cat {{path/to/file}} | sponge -a {{path/to/file}}`
|
|
|
|
|
|
|
|
|
|
- Remove all lines starting with # in a file:
|
|
|
|
|
|
2025-05-08 12:26:01 -06:00
|
|
|
`grep {{[-v|--invert-match]}} '^{{#}}' {{path/to/file}} | sponge {{path/to/file}}`
|