Date: Mon, 7 Aug 2000 05:45:52 +0200 (CEST) From: Cyrille Lefevre <clefevre@citeweb.net> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/20449: strange behaviour of sed 's/ */ /' w/ or w/o g Message-ID: <200008070345.FAA24264@gits.dyndns.org>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008070345.FAA24264>