On Fri, May 31, 2013 at 03:00:46AM +0200, John Kearney wrote:
> { rm file && awk 'whatever' >file } <file
Nitpick: you need a ; or newline before the closing }.
As others have said, this isn't safe -- if awk fails, or if the system
crashes before awk finishes, the file will be gone with no backup copy.