[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] modifying files in place.
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] modifying files in place. |
Date: |
Fri, 31 May 2013 08:46:54 -0400 |
User-agent: |
Mutt/1.4.2.3i |
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.