TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [TCLUG:7538] printing (lpr/lpd?) problems




> -----Original Message-----
> From: Carl Wilhelm Soderstrom [mailto:carls@agritech.com]
> >
> >  What happens when you try to
> >print a text file from the command line (i.e. lpr -P hp4v test.txt) in
> >scoansi or vt100 emulation?  Is the printer set up in /etc/printcap?
>         works fine. i can print any text file from the command
> line, no problem.
>         (it craps out on postscript; but i attribute that to printtool
> configuring problems.)

Might be the version of GhostScript, too.  Upgrading to RH 6.0 will
definitely help with the print filters.

> >
> >  How about "| lpr -P hp4v" ?  Note that
> >I'm using a pipe ("|") instead of a re-direct (">") to pass it to the lpr
> >daemon.
>         didn't try the pipe. I'm still new enough to UNIX that I
> don't fully
> understand the difference between them.

Ah, this is an important concept.  A redirect sends a program's STDOUT to a
device or a file.  A pipe sends a program's STDOUT to the STDIN of another
program, effectively joining the two programs together into one.  This lets
us Unix/Linux geeks accomplish complicated feats with one line of code! :)
i.e. 'du / | sort -n -r | head -50 | mail cpatte -s"Here's the biggest 50
files and directories on our server"'

If the OSAS system forces you to use a redirect, you may be able to do
something like "> /tmp/tmprpt.txt ; lpr -r -Php4v /tmp/tmprpt.txt"  This
redirects the output to a temp file, then runs the print process to print
and remove that file.  You'll encounter problems, though, if two people run
reports at the same time.

Incidentally, your vendor may be assuming that the "-s" option to lpr makes
it print silently.  This is true under SCO Unix but NOT true under RH Linux.
Under Linux this option creates a symbolic link to the spool directory,
which doesn't make any sense since you're working with STDOUT and not a
file.  Try getting rid of "-s" and see if it helps.  RH Linux prints
silently by default.

<from your second message>
>>If you hook a printer to the parallel port on your server, and use ">
>>/dev/lp1'" does it print normally?
>        it prints fine from the command line; however, I don't know how to
>configure it for OSAS, and it gives me some strange error about the
>operating system.

Can't help you on the OSAS side, that's up to your panel of experts.  If you
could post the OS error, though, it would be a great help.

Good luck!

--
Carl Patten
Systems Administrator
Trimodal Inc.