Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!inria!axis!axis!coms!john From: john@design.axis.fr (John H) Newsgroups: comp.unix.i386 Subject: Re: 386ix and Parallel Printers Summary: Well, this is pretty dumb, but Message-ID: <325@design.axis.fr> Date: 5 May 90 00:13:39 GMT References: <3@ttc.UUCP> <134576@sun.Eng.Sun.COM> <1990Apr21.033100.19633@pegasus.com> Organization: Axis Design, 135 rue d'Aguesseau 92100 Boulogne France Lines: 60 In article <1990Apr21.033100.19633@pegasus.com>, richard@pegasus.com (Richard Foulk) writes: > In article <134576@sun.Eng.Sun.COM> plocher@sun.UUCP (John Plocher) writes: > >+-- In <3@ttc.UUCP> marc@ttc.info.com (Marc O'Krent) writes > >| I have a Toshiba P1340 running under 386ix, and can't get the tabs > >| to be expanded. Consequently every file with tabs in it causes the > >+-- > > > >In the /usr/spool/lp/interface/mumble file you need to change the line > >that currently reads something like > > cat $FILE > >to something like > > expand $FILE > > He'll first have to get a copy of "expand" which doesn't come with 386/ix. > > -- > Richard Foulk richard@pegasus.com I know this isn't right (it isn't even well written) but it works! #include main (int argn, char *argv []) { /* Expand tabs in input file */ int ch; int pos = 0; int tab = 8; if (argn > 1) { tab = atoi (argv [1]); if (tab <= 0 || argn > 2) { puts ("Usage: expand [ tab_pos ] out"); exit (0); } } while ((ch = getchar ()) != EOF) { if (ch == '\n') { pos = 0; putchar (ch); } else if (ch == '\t') { do { putchar (' '); pos += 1; } while (pos % tab != 0); } else { putchar (ch); pos += 1; } } } John Hughes.