A Small dos->UNIX convertor

François Pinard pinard at iro.umontreal.ca
Sun Oct 31 03:28:18 EST 1999


bernhard at alpha1.csd.uwm.edu (Bernhard Reiter) writes:
> Magnus L. Hetland <mlh at vier.idi.ntnu.no> wrote:
> >William Park <parkw at better.net> writes:
> >> Moshe Zadka wrote:

> >> > I wrote a simple dos file -> UNIX file (i.e., removes \r's), with some
> >> > cute features, such as automatic decend through directories, keep same
> >> > "last changed" time and more.

> >> What's wrong with 'fromdos' and 'todos' [...]
> >Or dos2unix/unix2dos [...]
> Hey, what about "recode"? :)

philh at vision25.demon.co.uk (Phil Hunt) writes:

> I'm a "tr" man, myself.

I also do `tr' in cases `recode' is not handily available.  By default,
`recode' protects timestamps when recoding a set of files over themselves,
but it does not recurse into directories.  To change CR-LF into LF for a
whole project, I guess that `find -type f | xargs recode /cl' would do.
To go from LF into CR-LF, I would use `find -type f | xargs recode ../cl'.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard






More information about the Python-list mailing list