dotfiles/.bin/OLD/print_pdf
2024-02-14 07:55:58 +01:00

18 lines
210 B
Bash
Executable File

#!/bin/sh -x
_file="${1%%.*}"
_ext="${1##*.}"
_out="/tmp/print-$(pwgen -1).ps"
convert_pdf() {
pdf2ps "$_file.$_ext" "$_out"
}
case $_ext in
[pP][dD][fF])
convert_pdf; lpr $_out;
;;
esac
rm -vf "$_out"