[Bug 5522] New: sed: jumps are not handled correctly inside command groups

bugzilla at busybox.net bugzilla at busybox.net
Thu Sep 13 22:47:43 UTC 2012


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

           Summary: sed: jumps are not handled correctly inside command
                    groups
           Product: Busybox
           Version: 1.19.x
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Standard Compliance
        AssignedTo: unassigned at busybox.net
        ReportedBy: steffen1956 at mailinator.com
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


Hi!

BusyBox' sed has problems when a command ground "{...}" ends with a jump
statement "b". I tried the following examples both in my local BusyBox 1.19.4
and in the VM (http://busybox.net/live_bbox/live_bbox.html) with version
1.20.0. Both examples work without any problems when executed by GNU sed.

example 1 (jump with label)
---------------------------
/ # echo 'a                                                                     
> b                                                                             
> c                                                                             
> d' | sed -ne ':a /^b/ {n;p;b a}'                                              
sed: unterminated {


example 2 (jump w/o label)
--------------------------
/ # echo 'a                                                                     
> b                                                                             
> c                                                                             
> d' | sed -ne '/^b/ {x;p;b}' -e 'h'                                            
sed: unterminated {


Adding a semicolon before the closing brace is a workaround in both cases.

/ # echo 'a                                                                     
> b                                                                             
> c                                                                             
> d' | sed -ne '/^b/ {x;p;b;}' -e 'h'
a

-- 
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