unix2mac [file ...]
unix2cpm [file ...]
cpm2unix [file ...]
cpm2mac [file ...]
mac2unix [file ...]
mac2cpm [file ...]
The nlcvt program, or any of its many aliases, is a filter to convert from one system's notion of proper line terminators to that of another. This usually happens because you've downloaded or otherwise directly transferred a text file in so-called ``binary'' rather than ``text'' mode.
Unix format considers a lone Control-J to be the end of line. Mac format considers a lone Control-M to be the end of line. The archaic CP/M format considers a Control-M and a Control-J to be the end of line.
This program expects its first argument to be of the form src2dst, where src and dst are both one of unix, mac, or cpm. (That's speaking canonically--many aliases for those systems exist: call nlcvt without arguments to see what names are accepted.) The converted data is written to the standard output. nlcvt does not do destructive, in-place modification of its source files. Do this instead:
cpm2unix < file.bad > file.good mv file.good file.bad
This program can also be called by the name of the conversion itself. Just create links to the nlcvt program for each systems, and the program use its own name to determine the conversion. For example:
#!/usr/bin/perl # make nlcvt links chomp($path = `which nlcvt`); @systems = qw(unix mac cpm); for $src (@systems) { for $dst (@systems) { next if $src eq $dst; ln($path, "${src}2$dst") || die $!; } }
%s
, was unknown. Call nlcvt without arguments for a list of valid conversion formats.
%s
, was unknown. Call nlcvt without arguments for a list of valid conversion formats.
%s
could not be opened for the reason listed in %m
.
%s
could not be close for the reason listed in %m
. This error is rare.
%m
. This could be caused by a full or temporarily unreachable file system.
-T
operator did not think the input file was a text file. The conversion is
still performed, but is of dubious value. If the file really was binary,
the resulting output may be mangled. Garbage in, garbage out.
This program is free and open software. You may use, copy, modify, distribute, and sell this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same.