File: mandb_fmt-script

package info (click to toggle)
man-db 2.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,332 kB
  • sloc: ansic: 82,993; sh: 7,868; lex: 1,555; makefile: 970; perl: 141; sed: 16
file content (28 lines) | stat: -rw-r--r-- 783 bytes parent folder | download | duplicates (11)
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
#! /bin/sh
# $1 : the source file
# $2 : the preprocessor string
# $3 : the output device (optional)

prog=`basename $0`
prepipe=
postpipe=

for p in `echo "$2" | sed 's/./& /g'`
do
  case $p in
  e) prepipe="$prepipe | /usr/bin/neqn" ;;
  g) echo "$prog: can't preprocess with grap" >&2 ;;
  p) echo "$prog: can't preprocess with pic" >&2 ;;
  t) prepipe="$prepipe | /usr/bin/tbl" ; postpipe="| /usr/bin/col" ;;
  r) prepipe="$prepipe | /usr/bin/refer" ;;
  v) echo "$prog: can't preprocess with vgrind" >&2 ;;
  *) echo "$prog: unknown preprocessor \`$p'" >&2 ;;
  esac
done

case $prog in
  mandb_tfmt) postpipe="| /usr/bin/troff -t ${3+-T$3}" ;;
  *) postpipe="| /usr/bin/nroff ${3+-T$3} $postpipe";;
esac

eval "cat /usr/export/exec/sun4/lib/tmac/tmac.an $1 $prepipe $postpipe"