Bug 5078 - sed mishandles \`
Summary: sed mishandles \`
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.19.x
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-11 19:44 UTC by dubiousjim
Modified: 2012-04-12 04:37 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 dubiousjim 2012-04-11 19:44:29 UTC
BusyBox 1.19.3, built against uClibc 0.9.32, on i686 Linux


The Gnu regex extensions \` and \' work properly in busybox grep:

# printf 'abc\ndef' | grep -oz '\`[a-f].' | od -cAn
   a   b  \0

# printf 'abc\ndef' | grep -oz '.[a-f]\'\' | od -cAn
   e   f  \0

So it looks like uClibc is handling them properly. And \' also seems to work right with BusyBox sed:

# printf 'abc\ndef' | sed -n 'N; s/.[a-f]\'\''/=&=/gp'; echo
abc
d=ef=

but there's something wrong with sed's handling of \`:

# printf 'abc\ndef' | sed -n 'N; s/\`[a-f]./=&=/gp'; echo
=ab==c
==de=f

Expected output:
=ab=c
def
Comment 1 dubiousjim 2012-04-12 04:37:48 UTC
BusyBox awk also displays this issue with \`. Like sed, it works properly with \'.