Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!steinmetz!ge-dab!codas!killer!wnp From: wnp@killer.UUCP (Wolf Paul) Newsgroups: comp.unix.xenix Subject: Re: zoo and MSDOS vs. UNIX Message-ID: <2074@killer.UUCP> Date: Thu, 12-Nov-87 17:35:02 EST Article-I.D.: killer.2074 Posted: Thu Nov 12 17:35:02 1987 Date-Received: Sun, 15-Nov-87 10:27:52 EST References: <1181@tut.cis.ohio-state.edu> <2062@killer.UUCP> Reply-To: wnp@killer.UUCP (Wolf Paul) Organization: The Unix(tm) Connection BBS, Dallas, Tx Lines: 48 In article <2062@killer.UUCP> richardh@killer.UUCP (Richard Hargrove) writes: > >MS-DOS files brought over to *ix can have the superfluous '\015's stripped >out with > > tr -d "\015" * > >There is no standard tool running on MS-DOS to achieve the converse, >but then the Unix-based toolset is quite a bit richer than MS-DOS's. The following is a little program which will do the converse on MS-DOS. It is rather primitive and needs to be invoked with commandline redirection, but it works. Compile with any reasonable DOS C Compiler and use like this: addcr < unixfile > dosfile /* addcr.c -- add CR characters to UNIX LF characters. * In the Public Domain */ #include main() { int c; while ( ( c = getchar() ) != EOF ) { /* Most DOS C Compilers will output 'CR/NL' for the C character '\n' */ if ( c == '\012') putchar('\n'); /* If the above does not work for you, delete the above line and use * the following instead: */ /* if ( c == '\012') putchar('\015'); */ /* putchar(c); */ } } /* End of addcr.c */ Wolf Paul ihnp4!killer!wnp