Best of the Newsgroups: xtod vs. lponlcr : stairstepping printers printing


What is this stuff?

If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):



From: Bela Lubkin <belal@caldera.com>
Subject: Re: xtod vs: lponlcr
Date: Wed, 27 Nov 2002 18:11:37 GMT References: <m18H6GV-0002PKC@cactus.com>


Hate these ads?




Jeff Hyman wrote:



>     I have a customer that is having a stair-stepping output issue
> to the printer.  I am not new to this problem and even have a FAQ
> on the topic. My question has to do with command '/usr/lib/lponlcr' 
> which I am not familar with.  I have no 'man' pages on this command. 
> I am most interested in finding out how it compares to what 'xtod' does... 
> if they are even comparable commands.

> # lp -dprinter_name  ascii_file 
> # cat ascii_file | lp -dprinter_name
> # cat ascii_file | xtod | lp -dprinter_name
> # cat ascii_file | /usr/lib/lponlcr | lp -dprinter_name














`xtod` and `lponlcr` are very similar.  xtod's source is more
complicated because it responds to the name you run it under (xtod or
dtox).  lponlcr is _really_ simple.  Aside from a ridiculous copyright
statement about how holy and confidential this stuff is, it's just:



  #include <stdio.h>


  
  main()
  {
          register int c;


  
          while ((c=getchar()) != EOF) {
                  if (c == '\n')
                          putchar('\r');
                  putchar(c);
          }
  }



xtod also: takes an optional single filename to read from instead of
stdin; and appends a control-Z (DOS EOF marker) to the end of the
output.



I believe DOS Merge comes with another set of these utilities, and VP/ix
probably did, and quite a number of utilities have an embedded ability
to do CRLF translation along with something else they're doing (e.g.
`ftp`).  It's a very frequent problem for Unix users, so the wheel has
been reinvented many times.



>Bela<


Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them.

I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.




Comments


Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments

If you want a picture to show with your comment, go get a Gravatar



ad

/Bofcusm/1810.html copyright 1997-2004 Bela Lubkin All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!





More:
       - Bela








card_image







Change Congress