blob: 4d963ca231927ebaec6761af63dab61ee92b7bec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#! /bin/sh
# $Header: qtroff.backup,v 1.1 88/01/15 13:05:19 simpson Rel $
# $Log: qtroff.backup,v $
#Revision 1.1 88/01/15 13:05:19 simpson
#initial release
#
#Revision 0.1 87/12/11 18:31:17 simpson
#beta test
#
# Unfortunately it is necessary to use this script for otroff since the
# troff macro file mount.nr must be read by otroff or the width tables in
# --OFONT-- will not be read. Two -m (macro) options cannot be given
# to otroff. If you could, we would name the macro file tmac.ount and use
# the command
# otroff -t -mount $* | lpr -t
# We would still have to resolve the flags to otroff and lpr though.
troffflags='-rv1 -t -F--OFONT--/ftXX'
lprflags='-t'
while [ $# -gt 0 ];do
case $1 in
# Begin of otroff flags
-o* | -n* | -m* | -i | -q | -f | -b | -a | -p* | -F* | -z)
troffflags="$troffflags $1"
shift
;;
# Begin of lpr flags
-P* | -\#* | -w* | -l | -t | -d | -g | -v | -c | -r | -h | -s | -L)
lprflags="$lprflags $1"
shift
;;
-C | -J | -1 | -2 | -3 | -4)
lprflags="$lprflags $1 $2"
shift; shift
;;
# Troff extension flags
-R*)
troffflags="$troffflags `echo $1|sed s/-R/-r/`"
shift
;;
# Lpr extension flags
-M)
lprflags="$lprflags -m"
shift
;;
# Any remaining flags go to troff
-*)
troffflags="$troffflags $1"
shift
;;
*)
break
;;
esac
done
if [ $# -eq 0 ]; then
readstdin=-i
else
readstdin=
fi
otroff $readstdin $troffflags --FILTER--/mount.nr $* | glpr $lprflags
|