-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lars Thuring wrote:

| [EMAIL PROTECTED] wrote:
|
|>> Looking for DOS2UNIX Tool execution while checkin the files, can any
one help on this.
|>
|>
|>
|> For unix, there is "flip".
|
|
| There is also "dos2unix" for Unix / Linux:


The following perl script should convert Mac and DOS text files to use UNIX line endings:


#! /usr/bin/perl -w


use strict;
use IO::File;

my $filename;
my $file;
my @lines;
my $line;

# Open stdin and stdout if no files are specified...
unshift @ARGV, "-" if ( !scalar ( @ARGV ) );

while ($filename = shift)
~        {
~        if ( !( $file = new IO::File "<$filename" ) )
~                {
~                warn "Couldn't open $filename for read: $!";
~                next;
~                }
~        @lines = $file->getlines;
~        if ( !( $file = new IO::File ">$filename" ) )
~                {
~                warn "Couldn't open $filename for write: $!";
~                next;
~                }
~        foreach $line ( @lines )
~                {
~                $line =~ s/\r\n?$/\n/g;
~                $file->print ( $line );
~                }
~        }

exit 0;

- --
~                *8^)

Email: [EMAIL PROTECTED]

Get CVS support at <http://ximbiot.com>!
- --
Man who live in glass house dress in basement.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Netscape - http://enigmail.mozdev.org

iD8DBQE/q+hiLD1OTBfyMaQRAoeuAJ9jqc5bP8DcEEw1FiB1hxTCSqqPkgCeLDGl
NEmjZxr7yYw2oUQ5SlUEMeI=
=sMyu
-----END PGP SIGNATURE-----




_______________________________________________ Info-cvs mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/info-cvs

Reply via email to