386BSD 0.1 development
[unix-history] / usr / othersrc / public / ghostscript-2.4.1 / pv.sh
CommitLineData
827055d8
WJ
1#!/bin/sh -f
2#
3# pv - preview a specified page of a dvi file in a Ghostscript window
4# usage: pv page file
5#
6# pv converts the given page to PostScript and displays it
7# in a Ghostscript window.
8#
9if [ $# -lt 2 ] ;then
10 echo usage: $0 'page_number file_name[.dvi]'
11 exit 1
12fi
13RESOLUTION=100
14TEMPDIR=.
15PAGE=$1
16shift
17FILE=$1
18shift
19trap "rm -rf $TEMPDIR/$FILE.$$.pv" 0 1 2 15
20dvips -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
21gs $FILE.$$.pv
22exit 0