home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / dcom / modems / 19295 < prev    next >
Encoding:
Text File  |  1993-01-11  |  1.6 KB  |  45 lines

  1. Newsgroups: comp.dcom.modems
  2. Path: sparky!uunet!stanford.edu!nntp.Stanford.EDU!johnw
  3. From: johnw@leland.Stanford.EDU (John Wiederhold)
  4. Subject: Re: Program for printing a file from a UNIX machine to a Local printer
  5. Message-ID: <1993Jan11.193132.7331@leland.Stanford.EDU>
  6. Sender: news@leland.Stanford.EDU (Mr News)
  7. Organization: DSG, Stanford University, CA 94305, USA
  8. References: <2B4DDA14.14499@ics.uci.edu>
  9. Date: Mon, 11 Jan 93 19:31:32 GMT
  10. Lines: 33
  11.  
  12. In article <2B4DDA14.14499@ics.uci.edu> wngai@bonnie.ics.uci.edu (Wayne Ngai) writes:
  13. >    Hi!  I was wondering if there is/are any existing program(s) out
  14. >there that would allow for a PC terminal to print a file on the Unix
  15. >machine to the local printer that's attached to the PC terminal. e.g.
  16. >say I'm hook up to a Unix machine via modem, and I want to print a
  17. >file on the Unix machine to my PC printer.  Is there anyway of doing
  18. >that without having to download the file to my PC and do some
  19. >conversion to printout the file?  i.e. sending the print job to
  20. >printer attached to terminal.  If there is such a program, could some
  21. >kind soul please tell me where and how can I get a hold of it?
  22.  
  23. The following shell script should do the trick:
  24. ----------------------------CUT HERE-----------------------------
  25. #!/bin/sh
  26. echo -n '<ESC>[5i'
  27. if [ $# -eq 0 ]; then
  28.    cat
  29. else
  30.    cat $*
  31. fi
  32. echo
  33. echo -n '<ESC>[4i'
  34. ---------------------------CUT HERE-------------------------------
  35.  
  36. Replace the "<ESC>" with the escape character (ASCII 27 I think).
  37. This should work on any good vt100 terminal, including Kermit and Telix.
  38. I call the script "pcprint" and you can type "pcprint filename" as well
  39. as pipe output directly to it.
  40.  
  41. -John
  42.  
  43.  
  44.  
  45.