# = can be omitted - it is inferred from the script name. # = If SCRIPT is one of the modes (with or without. # = MODE is one of unix2dos, dos2unix, tounix, todos, tomac The following is a complete script based on the above answers along with sanity checking and works on Mac OS X and should work on other Linux / Unix systems as well (although this has not been tested). You can either run unix2dos on your DOS/Windows machine using cygwin or on your Mac using MacPorts. Mac OS X is Unix based and has the same line endings as Unix. In Mac text files, prior to Mac OS X, line endings exist out of a In Unix text files lineĮndings exists out of a single Newline character which is equal to a DOS Line Feed (LF) character. In DOS/Windows text files line endings exist out of a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). Regular files, such as soft links, are automatically skipped, unless conversion is forced.ĭos2unix has a few conversion modes similar to dos2unix under SunOS/Solaris. The Dos2unix package includes utilities "dos2unix" and "unix2dos" to convert plain text files in DOS or MAC format to UNIX format and vice versa. You probably want unix2dos: $ man unix2dosĭos2unix - DOS/MAC to UNIX and vice versa text file format converterĭos2unix
0 Comments
Leave a Reply. |