[ale] sed question
Geoffrey
esoteric at 3times25.net
Thu Nov 7 09:40:33 EST 2002
David S. Jackson wrote:
> On Wed, Nov 06, 2002 at 09:32:45PM -0500 Geoffrey The Esoteric <esoteric at 3times25.net> wrote:
>
>>What is it that you're trying to substitute for? Looks to me like it's
>>a space for a space????
>
>
> It's an escaped space, or it's supposed to be.
I guess I'm confused, which is easily done. You're trying to change all
spaces to spaces with a backslash in front of them? If this the case,
then this should work:
sed 's/ /\\ /g' filename > newfilename
>
> You know, I think it's my choice of the "for" statement that is
> messing things up; "for" takes the spaces and makes a list of all
> items separated by a space. I'm trying to ask "for" to behave
> differently by seeing a space but not using it to create the
> list. I was forgetting that "for" was interpreting the spaces,
> not the shell. Oops.
>
> So, the "cat sample.txt|while read line" structure suggested
> earlier would be the one to use here, because while won't act on
> the spaces.
>
> Guess I just get addicted to "for" sometimes. :-)
>
--
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