#!/bin/bash # # Syntax: mdvi [-h] filename [...] # # Purpose: Runs xdvi on the given .dvi files. # The -h flag shows the help info for this command. # Created: Jun 1, 1995 by Bart De Schutter # Last revised: Jan 22, 2002 by Bart De Schutter # # See http://www.deschutter.info/util/scripts.html for the latest version of # this script. # Status: public # Category: latex if [ $# -ge 1 -a "$1" = "-h" ]; then sed '/^$/q;/^#!/d;s/^# //;s/^#//' $0 >&2 exit 1 fi if [ $# -eq 0 ]; then echo >&2 echo >&2 "ERROR: ${0##*/} requires at least 1 input argument." echo >&2 sed '/^$/q;/^#!/d;s/^# //;s/^#//' $0 >&2 exit 1 fi shopt -q -s expand_aliases # OK, necessary in case xdvi is an alias. for fname in "$@" do xdvi "${fname%.dvi}.dvi" done