]> Dogcows Code - chaz/yoink/blobdiff - arch/win32/unix2dos.sh
repository reorganizing
[chaz/yoink] / arch / win32 / unix2dos.sh
diff --git a/arch/win32/unix2dos.sh b/arch/win32/unix2dos.sh
new file mode 100755 (executable)
index 0000000..c3ee7a8
--- /dev/null
@@ -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 
+
This page took 0.021829 seconds and 4 git commands to generate.