backend script

Anonymous anonymous at easysw.com
Thu Jan 26 13:40:46 PST 2006


How did you know about $6?

Where did you find the docs for this?

Thanks,

---
Jim


>
> A backend or a filter gets its input via stdin or via file
> if the optional 6th parameter is specified.
>
> You would have to store the input in a temporary file and
> then send this temporary file to the other queues, like
> --------------------------------------------------------
> # have the input at fd0 (stdin) in any case
> [ -n "$6" ] && exec <"$6"
>
> # have the input as regular file
> MY_NAME=${0##*/}
> INPUT=$( mktemp /var/spool/cups/tmp/$MY_NAME.XXXXXX )
> cat - >$INPUT
>
> # send it to the other queues
> for QUEUE in printer-01 printer-02 printer-03
> do lp -d $QUEUE $INPUT
> done
>
> # remove the temporary file
> rm $INPUT
> exit 0






More information about the cups mailing list