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