#!/bin/sh # # Invokes grid and converts the output to PDF # usage () { grid exit 1 } while getopts ":x:y:s:i:t:c:l" c do case "$c" in x) ;; y) ;; s) ;; i) ;; t) ;; c) ;; l) ;; :|'?') usage;; esac done if [ $OPTIND -gt $# ]; then usage; fi eval pdf=\"\${$OPTIND%.*}.pdf\" grid "$@" | ps2pdf - >"$pdf" .