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

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



>   Resent-Cc: recipient list not shown: ;
>   X-Envelope-Sender: dwarf@polaris.net
>   Date: Wed, 26 Nov 1997 12:02:04 -0500 (EST)
>   From: Dale Scheetz <dwarf@polaris.net>
>   cc: debian-user@lists.debian.org
>   Resent-From: debian-user@lists.debian.org
>   X-Mailing-List: <debian-user@lists.debian.org> archive/latest/19637
>   X-Loop: debian-user@lists.debian.org
>   Precedence: list
>   Resent-Sender: debian-user-request@lists.debian.org
>   Content-Type: TEXT/PLAIN; charset=US-ASCII
>   Content-Length: 2664
>   
>   On Wed, 26 Nov 1997, Aaron Denney wrote:
>   
>   > dwarf@polaris.net 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.)
>   




You should do it this way (if I understand you problem correctly):

sed -e 's/	//g' .......

	^^^^^^^
This is the "quoted" tab -- you can enter it on bash's command line by
prefixing TAB with control-v.

Alex Goncharov

>   If all that sounds like whining and complaining, I want to make it quite
>   clear that I greatly appreciate the help provided.
>   
>   Thanks,
>   
>   Dwarf
>   -- 
>   _-_-_-_-_-_-                                          _-_-_-_-_-_-_-
>   
>   aka   Dale Scheetz                   Phone:   1 (904) 656-9769
>         Flexible Software              11000 McCrackin Road
>         e-mail:  dwarf@polaris.net     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
>   debian-user-request@lists.debian.org . 
>   Trouble?  e-mail to templin@bucknell.edu .
>   
>   


--
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: