Re: something unclear with sed for me

2005-05-11 Thread Phil Dyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andras Lorincz wrote: > I want to replaces all multiple spaces with one space. My first > attempt was this: > > sed -e 's/\ */\ /g' > > This replaced all multiple spaces with one but as a side effect, sed > inserted a space between all characters.

Re: something unclear with sed for me

2005-05-11 Thread Kamaraju Kusumanchi
Andras Lorincz wrote: I want to replaces all multiple spaces with one space. My first attempt was this: sed -e 's/\ */\ /g' This replaced all multiple spaces with one but as a side effect, sed inserted a space between all characters. Playing a little I tried this: sed -e 's/[\ ]\ */\ /g' and this w

RE: something unclear with sed for me

2005-05-11 Thread Cho Wooyoung
> From: Andras Lorincz [mailto:[EMAIL PROTECTED] > > I want to replaces all multiple spaces with one space. My > first attempt was this: > > sed -e 's/\ */\ /g' > > This replaced all multiple spaces with one but as a side > effect, sed inserted a space between all characters. Playing > a lit

Re: something unclear with sed for me

2005-05-11 Thread David Jardine
On Wed, May 11, 2005 at 03:01:47PM +0300, Andras Lorincz wrote: > I want to replaces all multiple spaces with one space. My first > attempt was this: > > sed -e 's/\ */\ /g' The asterisk means zero or more, so it matches evven if there are no spaces. > > This replaced all multiple spaces with

something unclear with sed for me

2005-05-11 Thread Andras Lorincz
I want to replaces all multiple spaces with one space. My first attempt was this: sed -e 's/\ */\ /g' This replaced all multiple spaces with one but as a side effect, sed inserted a space between all characters. Playing a little I tried this: sed -e 's/[\ ]\ */\ /g' and this works. The fact is