BSD 3 development
[unix-history] / usr / src / cmd / net / nettroff.sh
CommitLineData
84c8332a
ES
1# nettroff typeset on CC or VAX typesetter
2# VAX->A version
3set local=v
4set typesetter=a
5set troff=troff
6set net=/usr/ucb/net
7set whoami=/usr/ucb/whoami
8onintr remove
9set flags=() noglob length=() fonts=() fontf=()
10top:
11 if ($#argv > 0) then
12 switch ($argv[1])
13
14 case -l*:
15 case -F:
16 case -1:
17 case -2:
18 case -3:
19 case -a:
20 case -b:
21 case -f:
22 case -g:
23 case -s*:
24 case -w:
25 echo $argv[1] not allowed.
26 exit(1)
27
28 case -*:
29 set flags = ($flags $argv[1])
30 shift argv
31 goto top
32
33 endsw
34 endif
35if ($#argv == 0) then
36 set argv=(-)
37endif
38$troff -t $flags $fontf $* >/usr/tmp/vp$$
39# check for valid format before sending off to A machine
40/usr/net/bin/chktroff /usr/tmp/vp$$
41if ($status != 0) then
42 goto remove
43endif
44set person=`$whoami`
45$net -q -m $typesetter -s /usr/tmp/vp$$ -c "nettroff $*" "/usr/lib/ntq -m $local -n $person"
46remove:
47rm -f /usr/tmp/vp$$
48if ($#fontf) then
49 rm -f $fontf
50endif