When invoked as unix2dos the program will convert a Unix text file to DOS format, when invoked as dos2unix it will convert a DOS text file to Unix format.
There exist many open source alternatives with different command names and options like dos2unix/unix2dos, d2u/u2d, fromdos/todos, endlines, flip.
For the opposite conversion (dos2unix) it is possible to use, for example, the utility tr with the -d '\r' flag to remove the carriage return characters: Note: The above method assumes there are only DOS line breaks in the input file.
An alternative to the dos2unix conversion is possible by using the col command that is available on Linux and other Unix-like operating systems, including Mac OS X.
After execution, OutFile is either created or replaced, and contains UNIX line endings.