Bug 8251 - sed not replace the words after Implement "+ N" range end
Summary: sed not replace the words after Implement "+ N" range end
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: 1.24.x
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-02 08:46 UTC by Taapat
Modified: 2016-01-24 14:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Taapat 2015-08-02 08:46:39 UTC
I am using the latest busybox from git. After this commit: http://git.busybox.net/busybox/commit/?id=63f4d32c9859c1ed341debefddad4b9c0ae944cc
I see strange things when use sed to replace words. Sometimes replace works, but sometimes not.

For example these replace foo in file test.txt as I expect:
sed -i 's/foo/bar/w' test.txt
sed -i 's/foo/bar-1/w' test.txt
sed -i 's/foo/t/w' test.txt
sed -i 's/foo/technic-1/w' test.txt
sed -i 's/foo/technical/w' test.txt

But these do no replace foo:
sed -i 's/foo/t-1/w' test.txt
sed -i 's/foo/t-2/w' test.txt
sed -i 's/foo/technical-1/w' test.txt
sed -i 's/foo/TemplatesInfoBarTechnical-1/w' test.txt

If I revert implement "+ N" range end commit, words replaces in all cases.
Comment 1 Denys Vlasenko 2016-01-24 14:54:54 UTC
Well, /w FILE option to s/// command never worked. I fixed this.
Now it works for me.
If you still have a problem, please reopen and attach your test.txt