X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=arch%2Fwin32%2Funix2dos.sh;fp=arch%2Fwin32%2Funix2dos.sh;h=c3ee7a8d336f5ef54c3a721c3fdb26198f8bf6a1;hp=0000000000000000000000000000000000000000;hb=cf4c819df08e2ab6c06532d8a4467fa58b2792ae;hpb=705fbbaf9a8064c034d23119e912da028af7fac7 diff --git a/arch/win32/unix2dos.sh b/arch/win32/unix2dos.sh new file mode 100755 index 0000000..c3ee7a8 --- /dev/null +++ b/arch/win32/unix2dos.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# +# Yoink +# An implementation of unix2dos using sed. +# + +if [ -f "$1" ]; +then + TMPFILE="$1.$$" + sed 's/\r*$/\r/' "$1" >$TMPFILE + if [ ! "$2" ]; + then + mv -f "$TMPFILE" "$1" + else + mv -f "$TMPFILE" "$2" + fi + rm -f "$TMPFILE" +else + echo "`basename $0` infile [outfile]" + echo " convert a file from unix to dos file format" + exit 1 +fi +