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

From: Macy1 Hallock (
Date: Thu Apr 13 2006 - 09:22:00 EDT

Eben King wrote:
> On Wed, 12 Apr 2006, Macy1 Hallock wrote:
>> 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.
> Dump to a temp file, and print that? "cat textfile.txt >/tmp/x;lpr x"
> will fit (10 chars) and sorta work. Unless /tmp/x already exists.
> Don't know a way to cram even basic security in 15 chars.
Clever enough, but doesn't work. Since I'm submitting a destination to a
redirect, the semicolon does not work for command chaining.
> Well, you could do something like this beforehand:
> mkfifo /tmp/cobol-lpr-pipe
> chmod 660 /tmp/cobol-lpr-pipe
> lpr /tmp/cobol-lpr-pipe &
> then run
> ...
> cat textfile.txt > /tmp/cobol-lpr-pipe
Both Eben and Wayne suggested using a named pipe, which I thought would
be a good solution. However, it does not work, error message returned by
cups is

lpr: unable to print file: client-error-bad-request

I also tried lp since it handles stdin slightly differently with the
same error msg returned.

Still looking for a solution... any suggestions welcomed.

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:27:33 EDT