home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / question / 15133 < prev    next >
Encoding:
Text File  |  1993-01-03  |  1.7 KB  |  39 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!mnemosyne.cs.du.edu!nyx!sscrivan
  3. From: sscrivan@nyx.cs.du.edu (steve scrivano)
  4. Subject: Re: Printer Escape codes
  5. Message-ID: <1993Jan4.011418.29507@mnemosyne.cs.du.edu>
  6. X-Disclaimer: Nyx is a public access Unix system run by the University
  7.     of Denver for the Denver community.  The University has neither
  8.     control over nor responsibility for the opinions of users.
  9. Sender: usenet@mnemosyne.cs.du.edu (netnews admin account)
  10. Organization: Nyx, Public Access Unix at U. of Denver Math/CS dept.
  11. References: <mohamad.725782260@cwis>
  12. Date: Mon, 4 Jan 93 01:14:18 GMT
  13. Lines: 24
  14.  
  15. In article <mohamad.725782260@cwis> mohamad@cwis.unomaha.edu (Mohamad Fadlallah) writes:
  16. >
  17. >I'm trying to write a small ksh script to control a printer setup,
  18. >for example ESC M or HEX (1B, 4D), HEX (9B, CD) sets Elite characters
  19. >on the printer.  Any idea on how to implement this in any way?
  20. >
  21. >I'd really appreciate your responses.
  22. >
  23. >
  24. >mohamad@cwis.unomaha.edu 
  25.  
  26. Well I don't know about ksh, but you could assign certain print codes to
  27. simple ascii codes similar to nroff like ".print12" could be elite and
  28. then you could write a "sed" filter that would replace those user codes
  29. with the real printer escape sequences on the way out to the printer.
  30.  
  31. Thus something like this "cat file|filter|lp.  Filter would be a series
  32. of "sed" scripts making the substitutions on the way to the printer.  This
  33. way, users don't have to deal with print codes when using an editor like
  34. "vi", etc., and "filter" does all of the interpreting by replacing ".print12"
  35. that a user imbeds in the text with the real sequences that drive the printer.
  36.  
  37. Steve Scrivano
  38. sscrivan@nyx.cu.du.edu
  39.