Subject: RE: Simplest way to translate file formats.
From: [email-masked] (John Wiersba)

10 Nov 1998 10:07:25 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain
To: "'Chris Searle'" <[email-masked]>, [email-masked]

If you have perl, you could try this script, which is what I use:

#!/bin/bash
perl -pe 's/\r?(\n?)\x1a?$/\1/' "$@"

This is meant to replace any combination of the characters CR LF ^Z (in
that order) at the end of a line with a LF (newline).

John Wiersba ([email-masked])

-----Original Message-----
From: Chris Searle [mailto:[email-masked]]
Sent: Thursday, November 05, 1998 1:09 PM
To: [email-masked]
Subject: Simplest way to translate file formats.

I've brought down a couple of tarballs for various ported apps for
cygwin, and some have LF line terminated files, some have CR LF files.
Now, all my mounts are binary, and configure barfs on CR LF.

I'm able to fix it by visiting each file in an editor that allows line
endings to be specified and so save them in LF format after which it
works a lot better.

However, I've got one now with hundreds of files, that's going to take
ages to solve - must be an easier way. My bash scripting is extremely
poor, I wondered about using a sed script to replace all occurances,
but a couple of questions:

If I were to create a text != binary mount and work in that would this
still be necessary.

I do have a sneaking feeling I'm missing something, after all, these
are from some of the more commonly visited port sites, and if everyone
had to do this then they would most likely have been changed by now.

If it affects things, I'm bringing them down as .tar.gz files and
using the tar binary from the full distribution as

tar -zxf tarball.tar.gz

This shouldn't put the different line terminators in should it?

Thanks all.

-- 
Chris Searle - [email-masked]
URL         : http://www.searle1.demon.co.uk/
ICQ         : 9437708 (see http://www.mirabilis.com)
Page me     : http://wwp.mirabilis.com/9437708
EmailExpress: [email-masked]

-
For help on using this list (especially unsubscribing), send a message
to
"[email-masked]" with one line of text: "help".
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".