in reply to sed deleting file

You should not write to the same file you are reading. You can use sed's -i~ flag to change the file "in place", or save the output under a different name.
Update: sorry, misread the question.

Replies are listed 'Best First'.
Re^2: sed deleting file
by ddrew78 (Beadle) on Dec 06, 2010 at 16:43 UTC
    I'm not...if you look, the file I'm writing to has a "1" at the end