1tofrodos(1) General Commands Manual tofrodos(1)
2
3
4
6 tofrodos - Converts text files between DOS and Unix formats.
7
9 fromdos [ options ] [file...]
10 todos [ options ] [file...]
11
13 DOS text files traditionally have carriage return and line feed pairs
14 as their newline characters while Unix text files have the line feed as
15 their newline character. fromdos converts ASCII and Unicode UTF-8 text
16 files from the DOS format to the Unix format, while todos converts them
17 from the Unix format to the DOS format.
18
19 The programs accept multiple filenames and wildcards as their argu‐
20 ments. You may also use them in a pipe. If either program finds its
21 input redirected, it will process stdin and place the output on stdout.
22
24 -a This option is deprecated. Do not use it unless you know what
25 you're doing. By default, Tofrodos does the expected thing for
26 text files. That is, when converting from DOS to Unix, it will
27 remove carriage returns only if they are followed by line feeds.
28 When converting from Unix to DOS, it will add carriage returns
29 only if the linefeeds are not already preceeded by carriage
30 returns. When Tofrodos is run on a normal text file that has
31 already been converted, the resulting file should be identical
32 to the original. However, if you use this option, the program
33 will always remove carriage returns in the DOS to Unix mode and
34 always add carriage returns in the Unix to DOS mode even if it
35 is not appropriate.
36
37 -b Make a backup of original file. The original file with a .bak
38 extension appended to the original filename, silently replacing
39 any existing file of that name. For example, a file called
40 "filename.ext" becomes "filename.ext.bak" replacing any existing
41 file having the name "filename.ext.bak". Important: the program
42 behaves differently if it is compiled for DOS (as compared to
43 being compiled for Windows, Linux, Mac OS X or other systems).
44 In view of the filename restrictions present on DOS, the DOS
45 executable will strip the original file extension, if any, from
46 the file before appending the .bak extension. For example,
47 "filename.ext" becomes "filename.bak".
48
49 -d Convert from DOS to Unix. This forces the program to convert the
50 file in a particular direction. By default, if the program is
51 named fromdos or dos2unix, it will assume that the input file is
52 in a DOS format and convert it to a Unix format. If the program
53 is named todos or unix2dos, it will assume that the input file
54 is in a Unix format and convert it to a DOS format. Using the -d
55 option forces the program to convert from a DOS format to a Unix
56 format regardless of how the program is named. Likewise, using
57 the -u option forces the program to convert from a Unix format
58 to a DOS format regardless of the name of the program.
59
60 -e Abort processing on any error in any file. Normally, the program
61 will simply skip to process the next file on the command line
62 when it encounters any errors. This option causes it to abort on
63 errors.
64
65 -f Force: convert even if the file is not writeable (read-only). By
66 default, if the program finds that the file does not have write
67 permission, it will not process that file. This option forces
68 the conversion even if the file is read-only.
69
70 -h Display a short help screen on the program usage and quit.
71
72 -l<logfile>
73 Log error messages to <logfile>. Note that if your command line
74 has an error, such as when you specify an unknown option, the
75 error message for the command line option error will be issued
76 to stderr instead and not logged.
77
78 -o Overwrite the original file (no backup). This is the default.
79
80 -p Preserve file ownership and time on Unix-type systems (like
81 Linux). On Windows and MSDOS, it only preserves the file time.
82 Note that on many Unix-type systems, including Linux, the file
83 ownership will only be preserved if the program is run as root,
84 otherwise it will just set the file time and silently fail the
85 change of file ownership. On such systems, if you want a warning
86 message when the file ownership cannot be changed, use -v (the
87 verbose flag) as well.
88
89 -u Convert from Unix to DOS. See the -d option above for more
90 information.
91
92 -v Verbose.
93
94 -V Show version message and quit.
95
97 Tofrodos terminates with an exit code of 0 on success and 1 on error.
98
99 If the program is invoked with multiple files on the command line, the
100 default behaviour is to skip to the next file in the list if an error
101 is encountered with any file. In such a case, the exit code returned
102 will the status of the last file processed (ie, 0 on success, 1 on
103 failure). If this is not desirable, use the -e option, which will force
104 the program to abort immediately with the appropriate exit code on
105 encountering any error.
106
108 The program and its documentation are copyrighted (c) 1996-2013 by
109 Christopher Heng. All rights reserved. They are distributed under the
110 terms of the GNU General Public License Version 2.
111
112 The latest version of tofrodos can be obtained from
113 http://www.thefreecountry.com/tofrodos/index.shtml
114
115
116
1172013 Version 1.7.13 tofrodos(1)