Re: mu dos2unix & unix2dos

From: Joshua Hudson (joshudson@hotmail.com)
Date: Thu Dec 06 2001 - 20:03:15 CET


>From: Michele Andreoli <m.andreoli@tin.it>
>
>On Wed, Dec 05, 2001 at 11:33:09AM -0800, Joshua Hudson nicely wrote:
> > dos2unix and unix2dos only work from tty or on single line files.
> > They should be replaced with these instead:
> >
> > #!/bin/ash
> > # mu dos2unix
> > tr '\012#' '#\012' | sed 's/#$//' | tr '\012#' '#\012'
> >
> > #!/bin/ash
> > # mu unix2dos
> > tr '\012#' '#\012' | sed 's/$/#/' | tr '\012#' '#\012'
> >
>
>From tty? Please, explain better. These command in mu works
>differently from standard Linuxes, because works only in pipe:
>
> cat dos.txt | dos2unix > unix.txt
> etc
>
My experience says that this previous command does not always work
unless dos.txt contains one or two lines.
>Anyway: what means:
> tr '\012#' '#\012' ?
>
>I think, "tr" only translate a single char. The char # is placeholder??
Basically, this swaps return and # characters so that sed can see
the return character.

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.dk
For additional commands, e-mail: mulinux-help@sunsite.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:21 CET