[ale] sed question
Geoffrey
esoteric at 3times25.net
Wed Nov 6 21:32:45 EST 2002
What is it that you're trying to substitute for? Looks to me like it's
a space for a space????
David S. Jackson wrote:
> How would I solve the following problem:
>
> ]$ for i in `cat sample.txt|sed -e 's/ /\ /g'; do
>
>>echo $i
>>done
>
>
> where sample.txt is a simple text files with words and sentences
> and spaces between the words. If I substitute an underscore
>
> ]$ for i in `cat sample.txt|sed -e 's/ /_/g'`; do
>
>>echo $i
>>done
>
>
> then the text comes out as I want it, except that there's an
> underscore where I want a space. However, when I try to add an
> escaped space so the shell will leave it alone, the escaped space
> never makes it to the echo statement (I guess), and I wind up
> with one single word per line.
>
> What's the way around this problem?
>
> TIA!
>
--
Until later: Geoffrey esoteric at 3times25.net
I didn't have to buy my radio from a specific company to listen
to FM, why doesn't that apply to the Internet (anymore...)?
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list