#!/bin/bash if [ $# -eq 0 ]; then echo "direct booklet \"Unknown\" \"Print a document in booklet form\"" exit 0 fi out=${DEVICE_URI#booklet:/} user=$2 title=$3 cat $6 | fixtd -tumble | psbook | /usr/bin/pstops "2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)" | lpr -T "$title" -U "$user" -P "$out" exit 0