# @(#)vtroff.sh 1.6 (Berkeley) %G%
# $troffmachine is where the troffing will be done.
set troffmachine
= ucbdali
# if the troff machine is not the local machine and it is up,
# use it otherwise troff (and sort) locally.
if ($troffmachine != `hostname` && \
`ruptime | grep -c "$troffmachine.*up"` == 1) then
set troffsh
= ( /usr
/ucb
/rsh $troffmachine )
set troffsh
= ( /bin
/sh
-c )
set flags
=() noglob length
=() fonts
=() fontf
=()
set macp
= (/usr
/lib
/tmac
/tmac.vcat
)
set sort = (/usr
/lib
/rvsort
)
set sort = (/usr
/lib
/rvsort
)
set sort = (/usr
/lib
/vsort
-W)
set vpr
= (/usr
/ucb
/vpr
-W)
echo -F takes following font name.
set argv
=(-1 $2.r
-2 $2.i
-3 $2.b
$argv[3-])
echo $1 takes following font name.
if (! -r /usr
/lib
/fontinfo
/$2) then
if (! -r /usr
/lib
/fontinfo
/$2.r
) then
echo ${2}: font not found.
echo .nr p
$fnum >> $fontf
cat /usr
/lib
/fontinfo
/$2 >> $fontf
set flags
= ($flags $argv[1])
/usr
/ucb
/soelim
$macp $fontf $argv[*] \
|
$troffsh "/usr/bin/troff -t -rv1 $flags | $sort $length"
/usr
/ucb
/soelim
$macp $fontf $argv[*] \
|
$troffsh "/usr/bin/troff -t -rv1 $flags | $sort $length | $vpr -t $fonts"