bug-coreutils
[Top][All Lists]
Advanced

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

Re: include dos2unix/unix2dos in coreutils ?


From: Bauke Jan Douma
Subject: Re: include dos2unix/unix2dos in coreutils ?
Date: Mon, 13 Nov 2006 18:23:05 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061025)

Matthew Woehlke wrote on 13-11-06 17:56:

Actually, dos2unix (the one I have, anyway) *does* do a few things that aren't so trivially done with sed. For one, it is in-place (unless told otherwise), and has --keepdate. In-place is awkward to do with sed.

At present I have my own shell script (using sed) that does exactly that,
keep the date, using two small home-written binary utilities to preserve
the time.  To me, this prerequisite is a argument /pro/ having coreutils
provide dos2unix/unix2dos (fromdos/todos, d2u/u2d, whatever).

Also, I find myself sometimes converting whole directories full of DOS-like
files, and a binary executable might be just a little more efficient here.

My current script btw. also handles possible multiple consecutive DOS
newlines.

Wow, that was a TERRIBLE example! ;-) I've used dos2unix enough to be annoyed by its lack of pervasiveness, but I don't know that I've *ever* used dirname (maybe 'basename', and only in scripts). To use your argument, dirname (and basename) is a simple hack that can be written as a trivial bash substitution. :-) Does that mean dirname should not be in coreutils?

Also, I find myself sometimes converting whole directories full of DOS-files,
and a binary executable might be just a little more efficient here.

In short, I agree with Woehlke here.


bjd






reply via email to

[Prev in Thread] Current Thread [Next in Thread]