lef(1) —
NAME
lef, dtou, utod − DOS-to-UNIX and UNIX-to-DOS line ending filters
SYNOPSIS
lef [ −z ] [ input_file ] [ output_file ]
dtou [ DOS_input_file ] [ UNIX_output_file ]
utod [ −z ] [ UNIX_input_file ] [ DOS_output_file ]
DESCRIPTION
lef is a filter that converts MS-DOS (DOS) format input to UNIX System format and UNIX System format input to DOS format. It automatically determines the format of the input and converts it to the opposite format. The dtou filter converts from DOS to UNIX System format, and utod converts from UNIX to DOS format.
When going from DOS to UNIX, carriage return/line-feed is converted into a new-line character, and if there is a CTRL z at the end of the file, it is removed. When going from UNIX to DOS, a new-line character is converted into carriage return/line-feed. The −z option will cause a CTRL z to be written at the end of the DOS output for backward compatibility with older DOS programs that use CTRL z to determine end-of-file.
If no arguments are specified, these programs read from standard input and write to standard output. If one argument is specified, that is used as the input file. If two arguments are specified, the first is the input file and the second is the output file.
To prevent accidental conversion of binary files, if there are certain control characters or any 8-bit characters in the input, or if the filter cannot otherwise determine that the input is either in DOS or UNIX System format, lef will write a “No translation” message to standard error, and the entire input will be copied to the output without being converted. To force translation, use either dtou or utod, which will do the specified conversion without qualification.
Examples
To convert a file from its original format to the opposite format:
lef infile outfile
To convert a DOS format file to UNIX System format:
dtou dosfile unixfile
To convert a UNIX System format file to DOS format, appending a CTRL z to the end:
utod −z unixfile dosfile
ADDED VALUE
This entry, supplied by INTERACTIVE Systems Corporation, is an extension of UNIX System V.
\*U — Version 1.0