3 ms·
Imo sponge is the most useful of all of them. For example if you want to filter a file in place you can do ‘grep str file | sponge file’. If you do that with a
by jleahy 6y ago
Imo sponge is the most useful of all of them. For example if you want to filter a file in place you can do ‘grep str file | sponge file’. If you do that with a redirect you’ll end up with an empty file.
Some commands (eg. sed) have an in-place option, but many don’t.