-
Notifications
You must be signed in to change notification settings - Fork 0
/
prov2
executable file
·71 lines (71 loc) · 1.57 KB
/
prov2
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
61
62
63
64
65
66
67
68
69
70
71
#! /bin/sh
#
# Usage: prov -text OVERLAY TEXTFILE ...
# prov -csv OVERLAY DEFFILE CSVFILE ...
#
# nkf is Network Kanji Filter (code converter)
NKF="nkf -x -w80"
#NKF="cat"
#
if [ "X${PROV2DIR}" = "X" ]
then
# PROV2DIR=/usr/local/prov2;export PROV2DIR
PROV2DIR=~/prov2;export PROV2DIR
fi
#
AWKDIR=${PROV2DIR}/awk
BINDIR=${PROV2DIR}/bin
ETCDIR=${PROV2DIR}/etc
#
if [ "X${PROV2PS}" = "X" ]
then
PROV2PS=${ETCDIR}/a4v.ps;export PROV2PS
fi
#
case $1 in
-text)
if [ "X${PROV2_KANJI_XGAP}" = "X" ]
then
PROV2_KANJI_XGAP=2.4;export PROV2_KANJI_XGAP
fi
#
${NKF} $2 |\
expand -t 8 |\
${BINDIR}/k2c >/tmp/prov.$$
shift 2
for i in $*
do
input=`echo $i | sed -e 's/^-$//'`
${NKF} ${input} |\
expand -t 8 |\
${BINDIR}/t2p -l `grep '^/SYS_MaxHeight *[0-9\.]* *def' ${PROV2PS}|head -1|sed -e 's/^\/SYS_MaxHeight *//' -e 's/ *def$//'`|\
${BINDIR}/ovps ${PROV2PS} /tmp/prov.$$
echo "grestore"
done
rm /tmp/prov.$$
;;
-csv)
${NKF} $2 |\
expand -t 8 |\
${BINDIR}/k2c >/tmp/prov.$$
deffile=$3
shift 3
for i in $*
do
input=`echo $i | sed -e 's/^-$//'`
${NKF} ${input} |\
${BINDIR}/brckt |\
${BINDIR}/k2c |\
awk -f ${AWKDIR}/csv2ps.awk $deffile - |\
${BINDIR}/ovps ${PROV2PS} /tmp/prov.$$
echo "grestore"
done
rm /tmp/prov.$$
;;
*)
echo "Usage: prov -text OVERLAY TEXTFILE ..."
echo " prov -csv OVERLAY DEFFILE CSVFILE ..."
echo ""
echo "TEXTFILE,CSVFILE : - mean stdin."
;;
esac