X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=win32%2Funix2dos.sh;fp=win32%2Funix2dos.sh;h=c3ee7a8d336f5ef54c3a721c3fdb26198f8bf6a1;hp=0000000000000000000000000000000000000000;hb=0b8dbc2d02c7f78d273ad9cfdf05c927c648ffd1;hpb=6c47a7028f7c72fabc40f417aa41111c28de8a84 diff --git a/win32/unix2dos.sh b/win32/unix2dos.sh new file mode 100755 index 0000000..c3ee7a8 --- /dev/null +++ b/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 +