tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

sed(1) / BRE bug?



Hello,

I have been surprised by the following (I made what I consider a mistake
in a RE with sed(1) but it went unnoticed under NetBSD since it
succeeded when, I think, it should not):

$ echo '$(VAR)' | sed 's/^$(\([^)][^)]*\))$/\1/'
VAR

The problem? the leading '$' is not escaped (I was trying to get the var
name from a Makefile)...

Is this a bug or is this behavior undefined or even required by
POSIX?

Best,
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                       http://www.sbfa.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index