[Top][All Lists]

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

Re: include dos2unix/unix2dos in coreutils ?

From: Alfred M. Szmidt
Subject: Re: include dos2unix/unix2dos in coreutils ?
Date: Mon, 13 Nov 2006 17:34:01 +0100 (CET)

   Well, then, whichever way. We're drifting off the original topic,
   which was 'should d2u-and-friends (or equivalents) be added to
   coreutils?'.  Can we address Mike's original question now, before
   he gets completely discouraged by this side-track? :-)

Personally, I think dos2unix is such a simple and seldomly used hack
to write in one line of sed that I don't see the point of it being
included[0].  To wit:

cat FILE | sed 's/
$//'  # CR/LF to LF.
cat FILE | sed 's/$/\r/'  # LF to CR/LF.

Also, should other types of line-endings be handled?  Like for example
CR-only line-endings (old Mac format IIRC).

[0]: Many of the things in coreutils can be written using one line of
sed, like tac, basename, dirname, but these are much more general
tools than dos2unix; compare the number of times you do dirname or tac
with dos2unix.  IMHO.


reply via email to

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