summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon GECOS <u@adam>2023-10-15 07:57:35 -0400
committerGordon GECOS <u@adam>2023-10-15 07:57:35 -0400
commiteff7ebebb0aa24880afd92fd84d0d97fbe9ebf48 (patch)
tree34c290cc811b25894f03c878468ec076cbde13cd
parent67e72130fec97cf31051fb48595b6b94c834054f (diff)
lpdf
-rwxr-xr-xdot/local/bin/lpdf18
1 files changed, 18 insertions, 0 deletions
diff --git a/dot/local/bin/lpdf b/dot/local/bin/lpdf
new file mode 100755
index 0000000..911be80
--- /dev/null
+++ b/dot/local/bin/lpdf
@@ -0,0 +1,18 @@
1#!/bin/bash
2
3# lpdf -- print with lp to a PDF file; output the filename to stdout
4
5lp "$@" -d PDF |
6{
7 read _ _ _ pdf _
8 case "$pdf" in
9 PDF-*) glob=$(printf "~/PDF/*-job_%s.pdf\n" "${pdf#PDF-}") ;;
10 *) exit 1 ;;
11 esac
12 sleep=0.1
13 while ! (eval "shopt -s failglob; echo $glob") 2>/dev/null
14 do
15 sleep $sleep
16 done
17}
18