Solved

Printing via telnet

Posted on 1997-11-26
15
518 Views
Last Modified: 2010-04-21
Is there a way to be able to print via Telnet?

I need to be able to print to a machine-attached printer from which I am telnetting to a remote host, running pine.  I do not have access to the config settings under pine, but I can print to a "terminal-attached printer" by default

Thanks

Vladislav
0
Comment
Question by:davidzon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 2
  • +3
15 Comments
 
LVL 1

Expert Comment

by:dhughes111797
ID: 2008045
did you already try 'Y' for print? (press O in pine and
you should see it)

It uses VT100 escape sequences to print. Of course, it will
only work if your using some sort of emulation that supports
passing the VT100 escape sequences back for printing..

0
 
LVL 1

Author Comment

by:davidzon
ID: 2008046
Yes, I've tried the Y to print.  It scrolls the message past my face and telnet does not pick up the print job.

Is there a version of telnet for BSDI (or source code that I can compile) out there that can be used so that when I print through pine (y to print) it will pass it on to the local LPD daemon?

0
 
LVL 1

Expert Comment

by:dhughes111797
ID: 2008047
You could take the source from NetBSD or FreeBSD and
compile it to support that. But you'll have to integrate
that in yourself. The telnet client doesn't support that
by default (sending to lpd). It'd probably be easier to
just rcp the file back and print it that way.. (or use
ssh and scp for a more secure way to do it)

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:davidzon
ID: 2008048
Hrmm... What clients are you aware of other than ssh that do this?  I would hate to have to install ssh client / daemon.


0
 
LVL 1

Expert Comment

by:dhughes111797
ID: 2008049
The only other way would be to write your own simple
client/server program to do it yourself. (in Perl for
instance - server running on your machine listens to
a connection on a port, receives file, and then prints
it using lpr)

0
 
LVL 1

Author Comment

by:davidzon
ID: 2008050
Anything server-based is not an option due to a possible security threat.  

I can not be the only one who has been faced with this problem!  Someone must have done this before...

0
 
LVL 1

Author Comment

by:davidzon
ID: 2008051
Anything server-based is not an option due to a possible security threat.  

I can not be the only one who has been faced with this problem!  Someone must have done this before...

0
 

Expert Comment

by:wjg
ID: 2008052
Two methods I can think of: 1) Run script(1) to capture the
output of your whole session and then some filter to extract
the stuff you want to print and 2) Try to solve this with
expect. Expect is available free on most TCL sites and can
probably be used to catch the vt100 printer escape sequence
for automagical redirection of the displayed printjob onto a
local printer (I haven't used expect for quite some time now -
no guarantee that this will work).
0
 
LVL 4

Expert Comment

by:jlms
ID: 2008053
Save the file in pine.
Copy it to your machine (ftp,rcp).
Print it.

If you are working in a UNIX machine (not a terminal) you should use the normal procedure for remote printing.

Please be more specific about how things are: type of machine and OS where you are could be a good start.

0
 

Expert Comment

by:grantk
ID: 2008054
Assuming the printer is attached to a system running lpd, just pipe the message to "lpr -Pprintername".

If the printer's on a Unix system, it should have lpd on it already, or you can download it. NT also has a LPD which comes with it.

So, what you'd need to do is:
1) set up lpr on the client
2) set up lpd on the server

For the client, you will need to create or change /etc/princap (as root, or the sysadmin must do it).

myprinter|aliasformyprinter|:\
:lp=:rm=remote.printer.ip.address.com:rp=raw:sd=/var/spool/lpd/myprinter:lf=/var/spool/lpd/myprinter-errs:

Then you can use "lpr -Pmyprinter" to print.


For the server, you'll need to read the docs with the program, but its usually pretty simple.


0
 
LVL 1

Accepted Solution

by:
tiago earned 100 total points
ID: 2008055
Your telnet must support printing to the current device (stdout).
Also, you must print using "attached-to-ansi" in Pine (in your case, the "terminal-attached" printer).

I know only one telnet that can do this, and it comes with the
Exceed package.
0
 
LVL 1

Author Comment

by:davidzon
ID: 2008056
If you can tell me where to get this package, I will give you a grade of A :>

thanks!

VSD

0
 
LVL 1

Expert Comment

by:tiago
ID: 2008057
0
 
LVL 1

Author Comment

by:davidzon
ID: 2008058
Excellent answer!

Thanks!

0
 
LVL 1

Author Comment

by:davidzon
ID: 2008059
Excellent answer!

Thanks!

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linux performance issues with 100% swap usage, etc 15 105
How to Insert a File Using Text Editor 9 111
Shell Script on AIX 7 177
comm diff cmp unix commands 2 18
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question