[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

I'm an idiot and sed proves it...

dwarf@polaris.net wrote:
> For the tabs, I try the following:
> 	sed -e 's/'\t'/ /g' <infile >outfile
> Which very cleanly places every t in the document with a space!??
> For the hyphonation I try:
> 	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.

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.


Aaron Denney

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: