the varian and versatec moved from ucbvax to ucbernie.
[unix-history] / usr / src / old / vpr / vtroff.sh
CommitLineData
4ff0f423 1#! /bin/csh -f
87707547
KM
2#
3# @(#)vtroff.sh 1.4 (Berkeley) %G%
4#
5set remote = ucbernie
6set execdir = /usr/ucb
7if ($remote != `hostname`) then
8 set cmd = "/usr/ucb/rsh $remote"
9else
10 set cmd = ""
11endif
7dff0e2e
BJ
12umask 0
13set flags=() noglob length=() fonts=() fontf=() macp=(/usr/lib/tmac/tmac.vcat)
14unset t
15top:
16 if ($#argv > 0) then
17 switch ($argv[1])
18
19 case -t:
20 set t
21 shift argv
22 goto top
23
24 case -l*:
25 set length = $argv[1]
26 shift argv
27 goto top
28
29 case -V:
30 unset wide
31 shift argv
32 goto top
33
34 case -W:
35 set wide
36 shift argv
37 goto top
38
39 case -F:
40 if ($#argv < 2) then
41 echo -F takes following font name.
42 exit(1)
43 endif
44 set argv=(-1 $2.r -2 $2.i -3 $2.b $argv[3-])
45 goto top
46
47 case -1:
48 case -2:
49 case -3:
50 if ($#argv < 2) then
51 echo $1 takes following font name.
52 exit(1)
53 endif
54 if (! -r /usr/lib/fontinfo/$2) then
55 if (! -r /usr/lib/fontinfo/$2.r) then
56 echo ${2}: font not found.
57 exit(1)
58 endif
59 set argv[2] = $2.r
60 endif
61 if ($#fonts == 0) then
62 set fontf=/usr/tmp/fnt$$
63 cp /dev/null $fontf
64 endif
65 @ fnum = 0 - $1
66 echo .nr p $fnum >> $fontf
67 cat /usr/lib/fontinfo/$2 >> $fontf
68 set fonts=($fonts $1 $2)
69 shift argv
70 shift argv
71 goto top
72
73 case -x:
74 set macp=()
75 shift argv
76 goto top
77
78 case -*:
79 set flags = ($flags $argv[1])
80 shift argv
81 goto top
82
83 endsw
84 endif
85if ($#argv == 0) then
86 set argv=(-)
87endif
88if ($?wide) then
89 if ($?t) then
39c23a4b 90 /usr/bin/troff -t -rv1 $flags $macp $fontf $* | /usr/lib/vsort -W $length
7dff0e2e 91 else
39c23a4b 92 /usr/bin/troff -t -rv1 $flags $macp $fontf $* | \
87707547 93 /usr/lib/vsort -W $length | $cmd $execdir/vpr -W -t $fonts
7dff0e2e
BJ
94 endif
95else
96 if ($?t) then
39c23a4b 97 /usr/bin/troff -t -rv1 $flags $macp $fontf $* | /usr/lib/rvsort $length
7dff0e2e 98 else
39c23a4b 99 /usr/bin/troff -t -rv1 $flags $macp $fontf $* | \
87707547 100 /usr/lib/rvsort $length | $cmd $execdir/vpr -t $fonts
7dff0e2e
BJ
101 endif
102endif
103if ($#fontf) then
104 rm $fontf
105endif