Re: [Code] Compiling

From: George Greer (greerga@circlemud.org)
Date: 05/07/99


On Fri, 7 May 1999, Patrick Dughi wrote:

>This is as simple as it can get.
>
>#!/usr/bin/perl
>
>if ($#ARGV != 0) {
>        die "Syntax: dos2unix.pl <file name>\n";
>}
>open (BROKEN,"$ARGV[0]") || die "Error: File $ARGV[0] does not exist\n";
>
>  while(<BROKEN>) {
>    s/\r+//;
>    print STDOUT $_;
>  }
>close(BROKEN);

Nope, try:

        perl -p -i -e "s/\r+//;" *.[ch]

The 'i' is strictly necessary there but it's handy in case you want to make
a backup (-i.bak) or you're expanding the file in the process of the
substitution.

>It was written to only strip one '^M' out, so it works best on new
>messages.  Of course, you can take a minute and strip em out by hand, or,
>if you're really lazy, just put it in a loop.

OasisOLC has the same problem.  There's a strip_cr() for that.

--
George Greer
greerga@circlemud.org


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST