Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Aug 2000 21:20:02 -0700 (PDT)
From:      Gregory Bond <gnb@itga.com.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/20449: strange behaviour of sed 's/ */ /' w/ or w/o g 
Message-ID:  <200008070420.VAA96862@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/20449; it has been noted by GNATS.

From: Gregory Bond <gnb@itga.com.au>
To: Cyrille Lefevre <clefevre@citeweb.net>
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




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