------------------------------------------------------------------------------ autolf - a utility program to convert file line-termination characters between formats used by different systems (e.g. Unix, DOS, OS-9). ------------------------------------------------------------------------------ This program will convert between each of the formats, in any direction. You do not need more than one program (e.g. dos2unix, unix2dos). The information presented here is somewhat brief, if anyone would like to write it up a bit better, please feel most welcome - email me a revised version for future distribution. I am initially releasing the following files: autolf24.lzh (version 2.4) 1995/03/01 autolf.osk OS-9/68K v2.4 autolf.sun SunOS v4.1.3 autolf.exe MS-DOS version autolf.txt This text file Currently in hand is a port to OS-9/6809; this will be uploaded to chestnut.cs.wisc.edu when available, and advised in comp.os.os9 As this is the first public release of the code, I have not included source code. The reason for this is two-fold: 1. So that I can co-ordinate the porting to different platforms. 2. The utility is written by me, for me. I do not expect it to meet everyones needs exactly, so I expect some suggestions to make the program better. Once things have stabilised a little, I expect to release the source code as well. Overview -------- autolf: copy stdin to stdout, converting end-of-line character sequences between the formats CR, LF and CRLF. Also expands tabs if required. If filenames are provided, then these are used instead of stdin. Version 2.4, date 1995/03/01 by Mike Tozer: autolf@vkthree.demon.co.uk See -x for licence. {on the MS-DOS version, '/' may be used as the lead-in for command line options if desired} Usage: autolf [] { []} -? print this information -h print this information -H show detailed information on conversions -c use CR on input as eol sequence -l use LF on input as eol sequence -C use CR on output as eol sequence -L use LF on output as eol sequence -N set -C & -L for this platform (i.e. cr) -z ignore all ^Z characters from input -Z add a ^Z character at the end of the file -k keep intermediate temporary file(s) -x show licence details -t[=][] expand tab characters (tab-size default is 4) If no -c, -l, -C, -L or -N specified, -t is set automatically If both -C & -L (or -c & -l) given, CR/LF is implied If neither -c or -l given, auto-detection of input format {i.e. first EOL sequence detected is used}. If none of -C, -L, -N given, output is based on input format: see -H Author: Mike Tozer, autolf@vkthree.demon.co.uk Licence Information ------------------- This software is supplied AS IS. No responsibility can be accepted for anything caused by using, or possessing this software. I have no control over how this program is used, and I have not issued or implied any warranty so I don't see why I should be responsible if it fails to perform in some way. If you don't like these conditions, don't use the program. You may use this program however you wish. It is not shareware, or anything like that, so you needn't send me any money (but I won't refuse any either!) You may copy and redistribute this software, providing that you do not modify the program, and that you do not charge anything for this software other than media and reasonable handling fees. Written in K&R C. Currently ported to: SunOs 4.1.x; MS-DOS; OS-9/68K If you would like this program available on another platform, and have a C compiler, please e-mail me. I will generally release the source code to allow porting, provided that the ported source & object is returned to me without any restrictions being imposed on it which would prevent free distribution of them. Bug reports and suggestions are also welcome. Simple Examples --------------- (Note that MS-DOS appears to do it's own conversions if stdin and/or stdout are redirected. Thus, the MS-DOS version will only operate directly on files, whereas OS-9 and unix versions will additionally accept redirected input & output. If I am wrong here, (and I hope I am!), please let me know. autolf -N readme.txt convert file to machine's native format note that the resultant format depends on the machine you're running it on. autolf -Ct4 readme.txt convert to OS-9 format (carriage returns only), expanding tabs at 4 column intervals autolf -L readme2.txt convert file to use Line Feeds (e.g. unix) autolf -CL readme.txt convert to Carriage Return/Line Feed (e.g. PC)