Re: I'm an idiot and sed proves it...
On Wed, 26 Nov 1997, Aaron Denney wrote:
> firstname.lastname@example.org wrote:
> > sed -e 's/-'\n'//g' <infile >outfile
> > and although the file gets slightly smaller (I didn't try to find out just
> > what had been removed) none of the hyphonated text is corrected.
> This isn't quite the appropriate venue for such questions, as it is
> a general unix/sed question and not very specific to Debian. In the
> future try the newsgroup comp.unix.programmer or comp.unix.questions.
You are absolutely correct, and as a developer I should probably know
better. My only excuse is that I spend a lot of time on this list, and
consider the folks here my friends. This leaves little time to go
exploring other venues, and besides, I'd rather ask a favor of a friend
than of some stranger somewhere else ;-)
Personally, I find the "off topic" threads on this list are often very
interesting. I almost always learn some new twist or trick that I had not
seen before, so it is my hope that, when I have problems, the solution may
be valuable to others as well.
> Your problem is that the inner quotes don't add another level quoting, but
> take away another level of quoting. To be a little clearer:
> > sed -e 's/'\t'/ /g' <infile >outfile
> ^^ ^^^^ are the quoted parts.
> The \t is not quoted, but is interpreted by your shell, which replaces the \t
> with an actual t. If you take out the inner quotes, it should work:
> sed -e 's/\t/ /g' <infile >outfile
> This will pass an actual \t to sed, which will interpret it as a tab character.
I think that I will never understand the ins and outs of these quoting
issues. However, this doesn't provide any better fix for my problem.
Removing the inner quotes results in sed carefully replacing all t
characters by the space character, and doing nothing to the tabs. (This
was, after all, my first try, before I went looking at examples and tried
the inner quotes. Your assurances didn't make it work any better the
second or third time I tried it either.)
If all that sounds like whining and complaining, I want to make it quite
clear that I greatly appreciate the help provided.
aka Dale Scheetz Phone: 1 (904) 656-9769
Flexible Software 11000 McCrackin Road
e-mail: email@example.com Tallahassee, FL 32308
_-_-_-_-_-_- If you don't see what you want, just ask _-_-_-_-_-_-_-
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to firstname.lastname@example.org .