From owner-freebsd-bugs Sun Aug 6 21:20: 4 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 DF67537B71F for ; Sun, 6 Aug 2000 21:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id VAA96862; Sun, 6 Aug 2000 21:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Sun, 6 Aug 2000 21:20:02 -0700 (PDT) Message-Id: <200008070420.VAA96862@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Gregory Bond Subject: Re: bin/20449: strange behaviour of sed 's/ */ /' w/ or w/o g Reply-To: Gregory Bond Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/20449; it has been noted by GNATS. From: Gregory Bond To: Cyrille Lefevre Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/20449: strange behaviour of sed 's/ */ /' w/ or w/o g Date: Mon, 07 Aug 2000 14:14:26 +1000 > $ echo 'a string with spaces' | sed 's/ */ /' > a string with spaces This is exactly what you've asked for: the first place which matches / */ (i.e. 0 or more spaces, i.e. the empty string at the beginning of the line) is replaced with a space. Similarly with the other 3 examples. Check up the meaning of "*" in regex(3). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message