#!/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"