[Top][All Lists]

[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/

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]