3 ms·
Meh, I was hoping for at least semi obscure things like the 'moreutils' utils. Speaking of which, many people don't know about the 'moreutils' utils. Check th
by burgerbrain 15y ago
Meh, I was hoping for at least semi obscure things like the 'moreutils' utils.
Speaking of which, many people don't know about the 'moreutils' utils. Check them out ;)
- pbhjpbhj 15y agohttp://blog.techfun.org/2009/08/moreutils-package-a-must/ http://blog.techfun.org/2009/08/moreutils-package-a-must/ vidir sounds very useful to me.
- kachnuv_ocasek 15y agoI see sponge is somehow useless, how is `| sponge /etc/passwd` different from `> /etc/passwd`.
- ominous_prime 15y agoThe redirect happens before the command is executed, so if you're trying to read from /etc/passwd, it's already been overwritten. Sponge will buffer the output and write the file after the first command has executed.
- kachnuv_ocasek 15y agoAh, excuse my ignorance.
- dedward 15y agoHe 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.