home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!uunet.ca!canrem!telly!druid!darcy
- From: darcy@druid.uucp (D'Arcy J.M. Cain)
- Subject: Re: dumping text to a local printer attached to a terminal?
- Message-ID: <1992Aug14.213647.11014@druid.uucp>
- Date: Fri, 14 Aug 1992 21:36:47 GMT
- References: <drenze.713553624@icaen.uiowa.edu> <1992Aug12.142109.12980@swbatl.sbc.com>
- Organization: D'Arcy Cain Consulting
- Lines: 43
-
- rollins@oktext.UUCP (Steven D. Rollins) writes:
- > This little script might work for you, it does for me. The first
- > line turns on vt100 print-pass-thru. the second cats your file to
-
- Just slightly hardware dependent. Here is my script:
-
- ----------------------------------------------------------------------
- #! /bin/sh
- # lpx - prints on attached printer if available
- # Written by D'Arcy J.M. Cain
-
- # first trap the exit in case we abort while passing through
- trap 'tput mc4; exit 0' 0
-
- # now pass through
- tput mc5
-
- # if there is an error try to supply some help
- if [ $? -ne 0 ]
- then
- echo "Your terminal doesn't seem to handle pass-through printing."
- echo "Please contact the administrator if you have a terminal that"
- echo "supports this feature and you would like to have it enabled."
- exit
- fi
-
- # now dump everything
- cat $*
-
- # note there is no cleanup code here - the exit is trapped above
- -------------------------------------------------------------------
-
- Notice that withot the comments, error checking, etc this boils down
- to simply:
- tput mc5
- cat $*
- tput mc4
-
- --
- D'Arcy J.M. Cain (darcy@druid.com) |
- D'Arcy Cain Consulting | There's no government
- Toronto, Ontario, Canada | like no government!
- +1 416 424 2871 DoD#0082 |
-