From owner-freebsd-bugs Sun Aug 6 20:50: 5 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 4CA3137BC66 for ; Sun, 6 Aug 2000 20:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA92589; Sun, 6 Aug 2000 20:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from racine.cybercable.fr (racine.cybercable.fr [212.198.0.201]) by hub.freebsd.org (Postfix) with SMTP id B7B6E37BC66 for ; Sun, 6 Aug 2000 20:45:54 -0700 (PDT) (envelope-from root@gits.dyndns.org) Received: (qmail 9200421 invoked from network); 7 Aug 2000 03:45:53 -0000 Received: from r227m167.cybercable.tm.fr (HELO gits.dyndns.org) ([195.132.227.167]) (envelope-sender ) by racine.cybercable.fr (qmail-ldap-1.03) with SMTP for ; 7 Aug 2000 03:45:53 -0000 Received: (from root@localhost) by gits.dyndns.org (8.9.3/8.9.3) id FAA24264; Mon, 7 Aug 2000 05:45:52 +0200 (CEST) (envelope-from root) Message-Id: <200008070345.FAA24264@gits.dyndns.org> Date: Mon, 7 Aug 2000 05:45:52 +0200 (CEST) From: Cyrille Lefevre Reply-To: Cyrille Lefevre To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/20449: strange behaviour of sed 's/ */ /' w/ or w/o g Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 20449 >Category: bin >Synopsis: strange behaviour of sed 's/ */ /' w/ or w/o g >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 06 20:50:00 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Cyrille Lefevre >Release: FreeBSD 4.1-RC i386 >Organization: ACME >Environment: FreeBSD gits 4.1-RC FreeBSD 4.1-RC #0: Tue Jul 18 01:55:07 CEST 2000 root@gits:/disk2/4.0-stable/obj/disk2/4.0-stable/src/sys/CUSTOM i386 >Description: well, sed(1) substitutions seems to be very buggy. see below. maybe it's regex(3), don't know yet. >How-To-Repeat: $ echo 'a string with spaces' | sed 's/ */ /' a string with spaces a space is prepended instead of replacing the first 2 spaces w/ one. $ echo 'a string with spaces' | sed 's/ */ /g' a s t r i n g w i t h s p a c e s all empty strings are matched instead of matching spaces $ echo 'a string with spaces' | sed 's/g*/x/g' xax x xsxtxrxixnx xwxixtxhx x xsxpxaxcxexsx $ echo 'a string with spaces' | sed 's/z*/x/g' xax x xsxtxrxixnxgx xwxixtxhx x xsxpxaxcxexsx in fact, not only space substitutions are very buggy. >Fix: n/a >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message