comparison lispref/permute-index @ 41200:c189486396ff

Don't depend on csh-specific features. Replace the interpreter name with /bin/sh.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 17 Nov 2001 15:04:56 +0000
parents acbf83fe6df1
children 23a1cea22d13
comparison
equal deleted inserted replaced
41199:bdecbfc5cb92 41200:c189486396ff
1 #!/bin/csh -f 1 #!/bin/sh
2 # Generate a permuted index of all names. 2 # Generate a permuted index of all names.
3 # The result is a file called index.fns. 3 # The result is a file called index.fns.
4 4
5 # Copyright (C) 2001 Free Software Foundation, Inc. 5 # Copyright (C) 2001 Free Software Foundation, Inc.
6 # 6 #
43 # change {-} to char form, so ptx wont ignore it. 43 # change {-} to char form, so ptx wont ignore it.
44 # delete leading \entry { 44 # delete leading \entry {
45 # change '\ ' to ' ' 45 # change '\ ' to ' '
46 # change lines with = < > since they mess up field extraction. 46 # change lines with = < > since they mess up field extraction.
47 # separate into fields delimited by " 47 # separate into fields delimited by "
48 rm -f permuted.raw
48 cat ${MANUAL}.fn | \ 49 cat ${MANUAL}.fn | \
49 sed \ 50 sed \
50 -e 's/(\([^)]*\))/\1/' \ 51 -e 's/(\([^)]*\))/\1/' \
51 -e 's/\\dots {}/(\\dots{})/' \ 52 -e 's/\\dots {}/(\\dots{})/' \
52 -e "s/{-}/{{\\tt\\char'055}}/" \ 53 -e "s/{-}/{{\\tt\\char'055}}/" \
55 -e 's,\\ , ,g' \ 56 -e 's,\\ , ,g' \
56 -e 's/{\\tt\\char61}/=/' \ 57 -e 's/{\\tt\\char61}/=/' \
57 -e 's/{\\tt\\gtr}/>/' \ 58 -e 's/{\\tt\\gtr}/>/' \
58 -e 's/{\\tt\\less}/</' \ 59 -e 's/{\\tt\\less}/</' \
59 -e 's/}{/"/g' \ 60 -e 's/}{/"/g' \
60 | awk -F\" '{print $2, $1}' >! permuted.raw 61 | awk -F\" '{print $2, $1}' > permuted.raw
61 62
62 2: 63 2:
63 # Build break file for ptx. 64 # Build break file for ptx.
64 cat <<EOF > permuted.break 65 cat <<EOF > permuted.break
65 - 66 -
66 : 67 :
67 EOF 68 EOF
68 # Build the ignore file for ptx. 69 # Build the ignore file for ptx.
69 # We would like to ignore "and", "or", and "for", 70 # We would like to ignore "and", "or", and "for",
70 # but ptx ignores ignore words even if they stand alone. 71 # but ptx ignores ignore words even if they stand alone.
71 cat <<EOF > permuted.ignore 72 cat <<EOF > permuted.ignore
72 the 73 the
73 in 74 in
74 to 75 to
82 from 83 from
83 by 84 by
84 EOF 85 EOF
85 86
86 echo "Make troff permuted index." 87 echo "Make troff permuted index."
88 rm -f permuted.t
87 ptx -i permuted.ignore -b permuted.break -f -r -w 144 \ 89 ptx -i permuted.ignore -b permuted.break -f -r -w 144 \
88 < permuted.raw >! permuted.t 90 < permuted.raw > permuted.t
89 91
90 3: 92 3:
91 echo "Extract the desired fields." 93 echo "Extract the desired fields."
92 awk -F\" '{printf "%s\"%s\"%s\n", $4,$6,$9}' permuted.t >! permuted.fields 94 rm -f permuted.fields
95 awk -F\" '{printf "%s\"%s\"%s\n", $4,$6,$9}' permuted.t > permuted.fields
93 96
94 4: 97 4:
95 echo "Format for texindex." 98 echo "Format for texindex."
96 # delete lines that start with "and ", "for " 99 # delete lines that start with "and ", "for "
97 sed < permuted.fields \ 100 sed < permuted.fields \