delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/06/11/22:41:50

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <02dd01bfd418$07323de0$8bc55f18@rochester.rr.com>
From: "Terry Lincoln" <lincoln2 AT rochester DOT rr DOT com>
To: <cygwin AT sourceware DOT cygnus DOT com>, "John Paulson" <munch AT powertv DOT com>
References: <4 DOT 2 DOT 2 DOT 20000609171552 DOT 00b482c0 AT mailhost>
Subject: Re: dos2unix shell script
Date: Sun, 11 Jun 2000 22:43:38 -0400
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600

----- Original Message -----
From: "John Paulson" <munch AT powertv DOT com>
To: <cygwin AT sourceware DOT cygnus DOT com>
Sent: Friday, June 09, 2000 8:21 PM
Subject: dos2unix shell script


> Appended is a script I use to convert CRLF to CR on

Unless your translating source to be read on a Mac, i'd change the above
line to read: "... CRLF to LF on"

> selected files.  To use it, the files to be converted
> must be on a
>
> <<< _binary_ mount point >>>
>
> _not_ a text mount point.
>
> I use it this way:
>
> bash$ find . -type f -name '[Mm]akefile*' | xargs dos2unix
>
> which will convert makefiles residing on a binary mount
> point, a common source of complaint on this list.
>
> Cheers!
>
>
> --- cut here ---
> #! /bin/sh
> if [ ! "$1" ] ; then
> echo `basename $0` file ...
> echo '  convert' filenames from dos to unix
> exit 1
> fi
>
> while [ "$1" ] ; do
> TMP=$1.$$
> if tr -d '\r' <"$1" >"$TMP" ; then
> cp -a -f "$TMP" "$1"
> fi
> rm -f "$TMP"
> shift
> done
>
> ----------------------------
> John Paulson
> PowerTV, Inc.
> Tel: 408/777-4769
> Fax: 408/777-0176
> mailto:paulson AT powertv DOT com
> http://www.powertv.com/
>
>
regards,

W. Terry Lincoln (please to CC replies to me)




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019