UNIX and Windows text-file formats

When you are using Interix, there are a few things you should know about UNIX and Windows text-file formats. For instance, when you create a text file using a Windows text editor, such as Notepad or MS-DOS Edit, each press of the ENTER key inserts two characters: a carriage-return character and a line-feed character. Text editors that run on POSIX systems only use a line-feed character to mark the end of a line. You can open a Windows text file in vi(1), but each line will end with the carriage-return character ^M.

Most Interix utilities require their scripts to be in POSIX format. This means that the end of a line of text can be marked with only a line-feed character. Some programs, however, such as ksh(1), make(1), and awk(1) with the -f option, will run scripts in either POSIX or Windows text format.

The flip(1) utility converts carriage-return/line-feed character combinations into a line-feed character and vice versa. The flip -u command converts a text file into the POSIX text format. The flip -m command converts a text file into the Windows/MS-DOS text format. For example, flip -u memo converts the file called memo into POSIX text format.