#!/bin/bash # (I'm at home in "/usr/lib/cups/backend/faxmail") # check number of arguments (embodied in $#): case $# in 0) echo "file faxmail \"Unknown\" \"Printing to my own PostScript processing program\"" exit 0 ;; 5) INPUT="-" break ;; 6) INPUT="$6" break ;; *) echo "Wrong number of arguments" echo "Usage: mypipe job-id user title copies options [file]" exit 1 ;; esac # do the backend's job: cat $INPUT > `mktemp --tmpdir=/tmp faxmail.XXXXX`