How is sponge different from > filename?
grep foo <some_file >some_file
But this will have the intended effect: grep foo <some_file | sponge some_file echo data | sudo sponge /etc/a.file
`tee` can be abused in a similar way, but it also prints the data to stdout, which is ugly.