delorie.com/archives/browse.cgi | search |
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: | <4.2.2.20000609171552.00b482c0@mailhost> |
X-Sender: | paulson AT mailhost |
X-Mailer: | QUALCOMM Windows Eudora Pro Version 4.2.2 |
Date: | Fri, 09 Jun 2000 17:21:30 -0700 |
To: | cygwin AT sourceware DOT cygnus DOT com |
From: | John Paulson <munch AT powertv DOT com> |
Subject: | dos2unix shell script |
Mime-Version: | 1.0 |
Appended is a script I use to convert CRLF to CR 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/ -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |