#!/bin/bash

##################################################################
# Based on d2u from http://www.geocities.com/usmbish/scripts.html
# (C) 2003 USM Bish <bish@nde.vsnl.net.in>
# Released under GNU GPL v2 - http://www.gnu.org/copyleft/gpl.html
##################################################################

if [ $# -ne 2 ]
then
     echo 1>&2 Usage: dos2unix [dosfile] [unixfile]
     exit 1
else     
    if ! [ -e $1 ]
    then
         echo "Error: $1 not found."
         exit 1
    fi
    if [ -e $2 ]
    then 
         echo "Error: $2 already exists."
         exit 1
    fi
fi

cat $1 | tr -d '\015' > $2


