Subject: bin/24641: possible bug in sed(1)
To: None <>
From: None <>
List: netbsd-bugs
Date: 03/02/2004 15:24:47
>Number:         24641
>Category:       bin
>Synopsis:       possible bug in sed(1)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 02 14:26:00 UTC 2004
>Originator:     Thomas Klausner
>Release:        NetBSD 1.6ZF
The following script works with GNU sed 4.07, but not with sed in -current (1.6ZF).

echo "a{b,c{x,y}}" | sed '
t a
s%\([^{ ]*\){\([^,{}]*\),\?\([^{}]*\)}\([^ ]*\)%\1\2\4 \1{\3}\4%
t b'

GNU sed outputs "ab acx acy" while NetBSD sed outputs "a{b,c{x,y}}".

I don't know sed enough to know if the expression conforms to some standard or not.
It should probably be fixed anyway for compatibility reasons; e.g. pkgsrc/net/jigdo
uses something like this.
Paste code above in shell window.
Not provided.