Bug 5078

Summary: sed mishandles \`
Product: Busybox Reporter: dubiousjim
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: minor CC: busybox-cvs
Priority: P5    
Version: 1.19.x   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

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 \'.