On 13/04/2012, Truls Becken <[email protected]> wrote: > You are right. I thought that since it only opens the output file > after stdin is fully consumed, it would not touch the file on failure. > The test below reveals that sponge leaves the file alone if the > process is interrupted before end of stdin, but not if a program > before it in the pipe returns non-zero. > > I guess I should test programs before suggesting them to others.
(^_^) Actually, it's not wrong — it would do the job, i.e. to mutate file in situ — it's just not quite sure enough. Cheers, strake
