Problems writing a simple backend

Neil Simmons ns at geotechnic.co.uk
Tue Dec 5 09:59:28 PST 2006


I have a program that generates text strings which are meant to go to a printer but I want to use the CUPS to do something a bit more useful with them. To this end I intend to write a simple backend which will take the text strings, reformat them and then send them out over the network to another unix box. This would work really well because once set up it would mean that any user could adjust settings in the program and send the data else where just by selecting a different printer.

I have written a very very very basic little script just to test that I have everything else in place before I try and do anything more complicated it seems that I have got something wrong. My scirpt for now is as follows.

#!/bin/sh
echo >> "start"
cat >> /text
echo >> "finish"

I literally just wanted to check that the data was passing through in a useable form for my purposes. How ever when I send a job to the printer that I have set up to use this backend script (set to executable) all that writes to the file is start finish. It appears that my script is not getting the stdin data. If I pipe data to it I get the results expected and if I print elsewhere using cups then the data passes straight through.

Please tell me what I am doing wrong??

Regards

Neil





More information about the cups mailing list