Skip to content

Instantly share code, notes, and snippets.

@dsprenkels
Created October 1, 2019 12:00
Show Gist options
  • Save dsprenkels/444d922aaa3c458b4a01e24e0756b59e to your computer and use it in GitHub Desktop.
Save dsprenkels/444d922aaa3c458b4a01e24e0756b59e to your computer and use it in GitHub Desktop.
#!/bin/sh
readonly txtfile="$(mktemp "print-plaintext.XXXXXXXXXX.txt")"
readonly pdffile="${txtfile/.txt/.pdf}"
cat "$@" >"$txtfile"
libreoffice --convert-to "pdf" "$txtfile"
lpr "$pdffile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment