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

newbie tip



look -- an objection! it's about time...

On Fri, Jun 29, 2001 at 02:21:13PM +0200, Carel Fellinger wrote:
> On Thu, Jun 28, 2001 at 10:03:15PM -0500, will trillich wrote:
> ...
> > -- 
> > DEBIAN NEWBIE TIP #56 from Vineet Kumar <debian-user@virtual.doorstop.net> 
> > :
> > Troubled by DOS-FORMAT OR MAC-FORMAT TEXT FILES? Here's another
> > way to deal with those troublesome ^M characters: a simple
> > 	tr -d '\015' < dos.file
> > should do the trick.  While we're on the subject, a Mac file
> > can be converted with
> > 	tr '\015' '\012' < mac.file
> > You can do all your CR/LF translations with tr as long as you
> > can remember that macs use CRs, *nices use LFs, and DOS uses
> > CRLF.
> 
> I object to classifying this as a NEWBIE tip:) There are better and
> simpler ways to achieve this, the tip as is will only scare people,
> fails to deal with the eof char, and doesn't *replace* the original
> file (the thing newbies are likely to expect).  Better advice to use
> one of the many special programs for this simply task.

i do have other tips that deal with this snag (some perl, some
vim) -- and if you'd like to recommend a different solution, i'd
be delighted to include it in my list (properly attributed, of
course)...

each tip is supposed to be terse, and mention one way (maybe
two, but not without serious consideration) to approach a
situation. it won't be a "tip" if i have seventeen pages
describing the fifty most popular ways to convert end-of-line
characters...

anyhew, i've changed it to:

	Troubled by DOS-FORMAT OR MAC-FORMAT TEXT FILES? Here's another
	way to deal with those troublesome ^M characters: a simple
		tr -d '\015'  < dos.file  > reg.file
	should do the trick.  While we're on the subject, a Mac file
	can be converted with
		tr '\015' '\012'  < mac.file  > reg.file
	You can do all your CR/LF translations with tr as long as you
	can remember that macs use CRs, *nices use LFs, and DOS uses
	CR+LF.

-- 
DEBIAN NEWBIE TIP #7 from Will Trillich <will@serensoft.com> 
:
Wondering what COMMANDS you have at your disposal? Try pressing
the TAB key at the command line. For example, "apt<TAB>" will
show you all the commands that start with "apt". (This is called
"completion" if you want to look it up in your shell's manpage.)
(Different implementions have the <TAB> completion set up
differently -- you may need to press <TAB> twice.)

Also see http://newbieDoc.sourceForge.net/ ...



Reply to: