[Bug 4069] New: sed with in-place operation (-i switch) truncates file to zero (i.e. file is lost)

bugzilla at busybox.net bugzilla at busybox.net
Tue Aug 16 08:24:24 UTC 2011


https://bugs.busybox.net/show_bug.cgi?id=4069

           Summary: sed with in-place operation (-i switch) truncates file
                    to zero (i.e. file is lost)
           Product: Busybox
           Version: 1.18.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P5
         Component: Networking
        AssignedTo: unassigned at busybox.net
        ReportedBy: ecaddict at gmail.com
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


Correct behavior:
echo -e "ln1\nln2\nln3\nln4" > /tmp/sedtest && /bin/sed '1,2d' /tmp/sedtest
produces (as expected)
ln3
ln4


Error:
echo -e "ln1\nln2\nln3\nln4" > /tmp/sedtest && /bin/sed -i '1,2d' /tmp/sedtest
&& cat /tmp/sedtest
truncates the file (makes it empty, so cat does not show any content)

I've reported this bug based on this discussion:
http://code.google.com/p/wl500g/issues/detail?id=252&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20Opened

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list