Debian Codegraph @

texk/texlive/linked_scripts/texlive-extra/dvi2fax.sh

raw symbols SCIP
1 #!/bin/sh
2 # options for dvips are passwd down
3
4 test -f /bin/sh5 && test -z "$RUNNING_SH5" \
5 && { UNAMES=`uname -s`; test "x$UNAMES" = xULTRIX; } 2>/dev/null \
6 && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; }
7 unset RUNNING_SH5
8
9 test -f /bin/bsh && test -z "$RUNNING_BSH" \
10 && { UNAMES=`uname -s`; test "x$UNAMES" = xAIX; } 2>/dev/null \
11 && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; }
12 unset RUNNING_BSH
13
14 # hack around a bug in zsh:
15 test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
16
17 progname=`basename "$0"`
18 help()
19 {
20 echo "Usage: $progname [-hi|-lo] file[.dvi] [options for dvips]"
21 echo " -hi: use high fax resolution (204x196) (default)"
22 echo " -lo: use low fax resolution (204x98)"
23 echo
24 echo "Example: $progname foo -l 2"
25 }
26
27 dvipsconf=dfaxhigh; gsdev=dfaxhigh
28 case $1 in
29 -hi) gsdev=dfaxhigh; shift;;
30 -lo) gsdev=dfaxlow; shift;;
31 esac
32
33 case $# in
34 0) help >&2
35 exit 1
36 ;;
37 esac
38
39 NAME=`basename "$1" .dvi`
40 dvips "$@" -P$dvipsconf -f |
41 gs -q -dSAFER -sDEVICE=$gsdev -sOutputFile="$NAME-%03d.fax" -sNOPAUSE -