Re: [SLUG] A simple script and printing question (?)

From: Macy1 Hallock (
Date: Wed Apr 12 2006 - 22:01:33 EDT

Macy1 Hallock wrote:

> A simple question for our SLUG bash wizards...
> I'm hacking a vendors ancient COBOL program output to print using lpr
> (via cups) in Fedora.
> Given a program output similar to that produced by "cat textfile.txt >"
> If I append the sting "/dev/ttyS01" it prints to the serial port. But
> I want to print using the cups spooler. I can't using lpr, because the
> pipe metacharacter won't function.
> So, how can I print the stdout via lpr under cups, not using a pipe?
> Note that I can't modify the command shown in quotes, I can only
> append to it, and there's a 15 character field limit to boot.
> Ideas, anyone?
Wayne Pollock sent along via email the following useful comments..

The answer may be to setup a named pipe, with mkfifo. Then you start
lpr (with any options you want) reading from the named pipe,
and later you can redirection output to it:

        mkfifo /tmp/prntr

Then to print with lpr and no pipe, repeat for each print job:

        lpr < /tmp/prntr &
        cat file > /tmp/prntr

Hope this helps!

-Wayne Pollock

P.S. As a SLUG digest reader I am not allowed to post to the list,
     please post this for me, thanks!

Macy Hallock  Hallock Consulting  Lutz, FL + Medina, OH
Tel 813-632-2988 Cell 813-493-8899 Email macy1 (at)

----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.

This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:26:56 EDT