1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/bash if [ -z "$1" ]; then echo "Usage: openmd file" exit 1 fi file="$1" tmp_pdf="$(mktemp --suffix=.pdf)" pandoc "$file" -o "$tmp_pdf" &>/dev/null zathura "$tmp_pdf" # cleanup after zathura closes rm -f "$tmp_pdf"