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 that I don't understand why the first one doesn't work. Can someone explain me that?
I dont know about sed. But you can do this with the tr command.
tr -s ' ' is what you are after. For more details see man tr.
raju -- Graduate student MAE, Cornell University
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]