blob: 911be8097bd3250c73161b76f5b103487ebdaa2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!/bin/bash
# lpdf -- print with lp to a PDF file; output the filename to stdout
lp "$@" -d PDF |
{
read _ _ _ pdf _
case "$pdf" in
PDF-*) glob=$(printf "~/PDF/*-job_%s.pdf\n" "${pdf#PDF-}") ;;
*) exit 1 ;;
esac
sleep=0.1
while ! (eval "shopt -s failglob; echo $glob") 2>/dev/null
do
sleep $sleep
done
}
|