Bug 4069

Summary: sed with in-place operation (-i switch) truncates file to zero (i.e. file is lost)
Product: Busybox Reporter: ecaddict <ecaddict>
Component: NetworkingAssignee: unassigned
Status: RESOLVED FIXED    
Severity: major CC: busybox-cvs
Priority: P5    
Version: 1.18.x   
Target Milestone: ---   
Hardware: All   
OS: All   
Host: Target:
Build:

Description ecaddict 2011-08-16 08:24:24 UTC
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