This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Simplest way to translate file formats.


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 (john.wiersba@medstat.com)

-----Original Message-----
From: Chris Searle [mailto:chris@searle1.demon.co.uk]
Sent: Thursday, November 05, 1998 1:09 PM
To: gnu-win32@cygnus.com
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 - chris@searle1.demon.co.uk
URL         : http://www.searle1.demon.co.uk/
ICQ         : 9437708 (see http://www.mirabilis.com)
Page me     : http://wwp.mirabilis.com/9437708
EmailExpress: 9437708@pager.mirabilis.com

-
For help on using this list (especially unsubscribing), send a message
to
"gnu-win32-request@cygnus.com" with one line of text: "help".
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]