From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 3 09:27:46 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2BF016A41F for ; Sat, 3 Sep 2005 09:27:46 +0000 (GMT) (envelope-from wigry@uninet.ee) Received: from mail.neti.ee (smtp-out-1.neti.ee [194.126.101.98]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C2B043D45 for ; Sat, 3 Sep 2005 09:27:45 +0000 (GMT) (envelope-from wigry@uninet.ee) Message-ID: <43196C96.6040504@uninet.ee> Date: Sat, 03 Sep 2005 12:27:50 +0300 From: Rein Kadastik User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee Subject: sed not working X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Sep 2005 09:27:47 -0000 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