Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printing to multiple spooled printers

Posted on 1999-07-23
3
Medium Priority
?
171 Views
Last Modified: 2013-12-15
Hi,
0
Comment
Question by:DarkNova
[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
  • 2
3 Comments
 

Author Comment

by:DarkNova
ID: 1629842
If people are confused by this, basically what would be ideal is if I could create a device called /dev/slp0 or something and if I issue the command "cat testfile.txt > /dev/slp0" then it would issue the command "lpr -PPRINTER0 < testfile.txt", and it would have devices /dev/slp1 for PRINTER1 and /dev/slp2 for PRINTER2. Then the program would work. These device files have to be some sort of pipes or devices though, because I tried writing a chmod 755 shell script and the program just overwrote it with its output (if it doesn't see it as a device it thinks its supposed to dump the output to that filename). Does this help any or is it more confusing now? Please post a comment if you have any questions.
0
 
LVL 1

Accepted Solution

by:
artemb earned 1200 total points
ID: 1629843
One possible solution is to use FIFOs ("mknod file p"). Create named pipe named /dev/slpX, write a script (or a program, which will be better) that will read from the FIFO and pipe everything to lpr.
Something like that:

#!/bin/sh
DEV=$1
shift
COMMAND=$2
shift

while true; do
   cat $DEV | $COMMAND "$@"
done
#--end of script

And then run it
./script /dev/slp0 lpr -pPRINTER0
./script /dev/slp1 lpr -pPRINTER1

The script is a draft just to illustrate the idea.

0
 

Author Comment

by:DarkNova
ID: 1629844
Thanks. This works good. For anyone who's looking back at this response, note that the line that says:
COMMAND=$2
should read:
COMMAND=$1
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

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

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

664 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