He explained it on the site - if you are trying to use grep to trim contents from a file and output them to the same file, you will end up with an empty file.
Seriously though - everyone knows this. Just use a temp file.
He says sponge "keeps the results in memory" - that's a problem if the file is huge.
Plus there are other tools to do in-place replacement.
Seriously though - everyone knows this. Just use a temp file.
He says sponge "keeps the results in memory" - that's a problem if the file is huge.
Plus there are other tools to do in-place replacement.