Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 03 Sep 2005 12:27:50 +0300
From:      Rein Kadastik <wigry@uninet.ee>
To:        freebsd-hackers@freebsd.org
Subject:   sed not working
Message-ID:  <43196C96.6040504@uninet.ee>

next in thread | raw e-mail | index | archive | help
Hi,

I have a very interesing problem with sed in FreeBSD.

Lets take the following sed command (from the ncurses MKlib_gen.sh script):

sed -e '/^\([a-z_][a-z_]*\) /s//\1 gen_/'

This command alters the input:
blah something -> blah gen_something

This works, but I have found a specific pattern, where it does not work:
int something -> int something

Does anybody have any idea, what would be the cause of the problem and 
how to fix it.

I also have several other FreeBSD systems, where the sed behaves 
correctly. I  also copied the sed over to the broken system, but no luck.

The broken system used to be 4.6-STABLE and I managed to upgrade it to 
4.11-RELEASE-p11 (without working sed). I hoped that upgrade procedure 
would elliminate the problem, but apparently not.

"which sed" points to /usr/bin/sed

"ident /usr/bin/sed" output:
# ident /usr/bin/sed
/usr/bin/sed:
     $FreeBSD: src/usr.bin/sed/compile.c,v 1.13.2.8 2002/08/17 05:47:06 
tjr Exp $
     $FreeBSD: src/usr.bin/sed/main.c,v 1.9.2.7 2002/08/06 10:03:29 fanf 
Exp $
     $FreeBSD: src/usr.bin/sed/misc.c,v 1.3.2.2 2002/07/17 09:35:56 tjr 
Exp $
     $FreeBSD: src/usr.bin/sed/process.c,v 1.10.2.11 2004/01/10 06:30:37 
tjr Exp $

I suspect, that it is some sort of a regex library issue as sed does not 
contain its own regex engine.

-- Rein




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43196C96.6040504>