> > What, you mean "perl -pe 's/\015\012/\n/g'" and "perl -pe 's/\n/\015\012/g'"?
> > Doesn't seem like it's necessary to me to even bother uploading such a thing.
> 
> So you think, but try working around non-UNIX and non-Perl people for
> a while, and the above are deep magic that bestows upon you the aura
> of a mighty guru.

Indeed. We have a bunch of people at my work who only know that text
files
from the unix machines come out "wrong" in certain programs on their PC.
And that's OK, because understanding text formats and regular
expressions
isn't part of their job.

Also, being lazy I'd rather not have to remember, or think about,
the above, and just type unix2dos :-)


> > If you're in the neighborhood though, how about mac2dos, mac2unix, unix2mac,
> > and dos2mac?  (Mac uses \015 only)
> 
> What would be cool is to have *one* script that sniffs which CR/LF is
> being used in the source file(s).  The destination CR/LF would be by
> default the execution platform's, but could be forced to be something
> else.  "crlf foo.txt", "crlf -t cr bar.txt".

How about a fixeol script? As you say, by default it would target the
host platform, but you could do:

        fixeol -tomac foo.txt

being a unix geek at heart, I think that this should look to see what
name it was invoked under, and change its behaviour accordingly.
But experience tells me better not to try and be that smart.

Thinking about what most users want, a distribution which has

        unix2dos dos2unix
        dos2mac mac2dos
        unix2mac mac2unix

wouldn't be too hard. I'd use the Template Toolkit to generate each of
these from generic bits. The scripts are mainly documentation anyway :-)

So yeah, this might seem overkill for what is essentially a simple job,
but it would mean I only have to write one more version.

And what's the script category? Text : Filter?

Neil

Reply via email to