blob: 792f661dd6034f8a2cf45680c342413a93932974 [file] [log] [blame]
Fred Drake566b6d51998-10-27 21:59:03 +00001#! /usr/bin/env ksh
Fred Drakee2e904f1998-03-10 23:23:05 +00002
Fred Drakec794c381998-08-12 17:50:07 +00003# This script may be invoked by naming it directly or via a shell alias,
4# but NOT through a symbolic link. Perhaps a future version will allow
5# the use of a symbolic link.
6#
7# Using a symbolic link will cause the script to not be able to locate
8# its support files.
9
Fred Drakee2e904f1998-03-10 23:23:05 +000010MYDIR=`dirname $0`
Fred Drakef558e311998-03-24 17:48:20 +000011WORKDIR=`pwd`
12cd $MYDIR
13MYDIR=`pwd`
Fred Drakeac8f91a1998-04-02 15:37:13 +000014cd ..
15TOPDIR=`pwd`
Fred Drakef558e311998-03-24 17:48:20 +000016cd $WORKDIR
Fred Drakee2e904f1998-03-10 23:23:05 +000017
18# DEFAULT_FORMAT must be upper case...
19DEFAULT_FORMAT=PDF
20USE_DEFAULT_FORMAT=true
Fred Drakedbc879e1998-03-11 15:33:44 +000021DISCARD_TEMPS=true
Fred Drakee2e904f1998-03-10 23:23:05 +000022
Fred Drake5d59d3d1999-02-15 16:27:42 +000023CONFIG_FILES=''
Fred Drake11300cc1998-08-05 04:48:18 +000024ICONSERVER=''
25
Fred Drakee1feb8f1998-08-28 20:21:04 +000026TEMPBASE=mkhowto-$LOGNAME-$$
Fred Drakeac8f91a1998-04-02 15:37:13 +000027
Fred Drakee1feb8f1998-08-28 20:21:04 +000028L2H_INIT_FILE=$TOPDIR/perl/l2hinit.perl
29L2H_AUX_INIT_FILE=/usr/tmp/$TEMPBASE.perl
30
31LOGFILE=/usr/tmp/$TEMPBASE.how
Fred Drakedbc879e1998-03-11 15:33:44 +000032LOGGING=''
33
Fred Drakee2e904f1998-03-10 23:23:05 +000034usage() {
Fred Drakeac8f91a1998-04-02 15:37:13 +000035 MYNAME=`basename $0`
Fred Drakeac8f91a1998-04-02 15:37:13 +000036 cat <<EOF
Fred Drakea5de7301998-10-19 19:14:42 +000037usage: $MYNAME [options...] file ...
Fred Drakeac8f91a1998-04-02 15:37:13 +000038
39Options specifying formats to build:
40 --html HyperText Markup Language
41 --pdf Portable Document Format (default)
42 --ps PostScript
43 --dvi "DeVice Indepentent" format from TeX
Fred Drakea5de7301998-10-19 19:14:42 +000044 --text ASCII text (requires lynx)
Fred Drakeac8f91a1998-04-02 15:37:13 +000045
Fred Drake9f6f0da1998-08-12 18:07:51 +000046 More than one output format may be specified, or --all.
Fred Drakeac8f91a1998-04-02 15:37:13 +000047
48HTML options:
49 --address, -a Specify an address for page footers.
Fred Drake88053541998-04-24 21:57:12 +000050 --link Specify the number of levels to include on each page.
Fred Drake437ff861998-10-07 16:46:54 +000051 --split, -s Specify a section level for page splitting, default: $MAX_SPLIT_DEPTH.
Fred Drake11300cc1998-08-05 04:48:18 +000052 --iconserver, -i Specify location of icons (default: ../).
Fred Drakeac8f91a1998-04-02 15:37:13 +000053
54Other options:
Fred Drake1a3541c1998-05-11 19:04:56 +000055 --a4 Format for A4 paper.
Fred Draked5d473f1998-05-11 20:40:24 +000056 --letter Format for US letter paper (the default).
Fred Drakeac8f91a1998-04-02 15:37:13 +000057 --help, -H Show this text.
58 --logging, -l Log stdout and stderr to a file (*.how).
59 --debugging, -D Echo commands as they are executed.
60 --keep, -k Keep temporary files around.
61 --quiet, -q Do not print command output to stdout.
62 (stderr is also lost, sorry; see *.how for errors)
63
64EOF
Fred Drake9f6f0da1998-08-12 18:07:51 +000065 if [ "$2" ] ; then
66 echo "$2"
67 echo
68 fi
Fred Drakeac8f91a1998-04-02 15:37:13 +000069 exit $1
Fred Drakee2e904f1998-03-10 23:23:05 +000070}
71
Fred Drake88053541998-04-24 21:57:12 +000072# These are LaTeX2HTML controls; they reflect l2h variables of the same name.
73# The values here are the defaults after modification by perl/l2hinit.perl.
74#
75ADDRESS=''
76MAX_LINK_DEPTH=3
Fred Drake437ff861998-10-07 16:46:54 +000077MAX_SPLIT_DEPTH=6
Fred Drake88053541998-04-24 21:57:12 +000078
Fred Drakee2e904f1998-03-10 23:23:05 +000079build_html() {
Fred Drake19c7c841998-05-07 21:20:39 +000080 TEXFILE=`kpsewhich $1.tex`
Fred Drakeb5210951998-10-16 17:34:34 +000081 TEXFILE="${TEXFILE#./}"
Fred Drake9940bd71998-08-06 20:15:20 +000082 BUILDDIR=${2:-$1}
Fred Drake11300cc1998-08-05 04:48:18 +000083 latex2html \
84 -init_file $L2H_INIT_FILE \
85 -init_file $L2H_AUX_INIT_FILE \
Fred Drake9940bd71998-08-06 20:15:20 +000086 -dir $BUILDDIR $TEXFILE || exit $?
Fred Drake88053541998-04-24 21:57:12 +000087 if [ "$MAX_SPLIT_DEPTH" -ne 1 ] ; then
Fred Drake9940bd71998-08-06 20:15:20 +000088 (cd $BUILDDIR; $MYDIR/node2label.pl *.html) || exit $?
Fred Drakeac8f91a1998-04-02 15:37:13 +000089 fi
Fred Drakee2e904f1998-03-10 23:23:05 +000090}
91
Fred Drake12f842e1998-04-17 02:52:12 +000092use_latex() {
93 # two args: <file> <latextype>
94 MYFILE=$1
95 MYLATEX=$2
96 #
97 # We really have to do it three times to get all the page numbers right,
98 # since the length of the ToC makes a real difference.
99 #
100 $MYDIR/newind.py >$MYFILE.ind
101 $MYDIR/newind.py modindex >mod$MYFILE.ind
102 $MYLATEX $MYFILE || exit $?
103 if [ -f mod$MYFILE.idx ] ; then
104 makeindex mod$MYFILE.idx
Fred Drakee2e904f1998-03-10 23:23:05 +0000105 fi
Fred Drake12f842e1998-04-17 02:52:12 +0000106 if [ -f $MYFILE.idx ] ; then
107 $MYDIR/fix_hack $MYFILE.idx
108 makeindex $MYFILE.idx
109 $MYDIR/indfix.py $MYFILE.ind
110 fi
Fred Drake566b6d51998-10-27 21:59:03 +0000111 if [ `grep -c '^\\\\bibdata{' $MYFILE.aux` -ne 0 ] ; then
112 USE_BIBTEX=true
113 bibtex $MYFILE
114 else
115 USE_BIBTEX=''
116 fi
Fred Drake8cab5491998-07-23 19:13:52 +0000117 if [ -f $MYFILE.syn ] ; then
118 # This hack is due to a bug with the module synopsis support that
119 # causes the last module synopsis to be written out twice in
120 # howto documents (not present for manuals). Repeated below.
121 uniq $MYFILE.syn >TEMP.syn && mv TEMP.syn $MYFILE.syn || exit $?
122 fi
Fred Drake12f842e1998-04-17 02:52:12 +0000123 $MYLATEX $MYFILE || exit $?
124 if [ -f mod$MYFILE.idx ] ; then
125 makeindex mod$MYFILE.idx
126 fi
127 if [ -f $MYFILE.idx ] ; then
128 $MYDIR/fix_hack $MYFILE.idx || exit $?
Fred Drakefbdddde1998-10-19 21:48:05 +0000129 makeindex -s $TOPDIR/texinputs/python.ist $MYFILE.idx || exit $?
Fred Drake12f842e1998-04-17 02:52:12 +0000130 fi
Fred Drakef4fc4761998-05-14 20:03:14 +0000131 if [ -f $MYFILE.toc -a $MYLATEX = pdflatex ] ; then
Fred Drake12f842e1998-04-17 02:52:12 +0000132 $MYDIR/toc2bkm.py -c section $MYFILE
133 fi
Fred Drake8cab5491998-07-23 19:13:52 +0000134 if [ -f $MYFILE.syn ] ; then
135 uniq $MYFILE.syn >TEMP.syn && mv TEMP.syn $MYFILE.syn || exit $?
136 fi
Fred Drake566b6d51998-10-27 21:59:03 +0000137 if [ "$USE_BIBTEX" ] ; then
138 bibtex $MYFILE
139 fi
Fred Drake12f842e1998-04-17 02:52:12 +0000140 $MYLATEX $MYFILE || exit $?
Fred Drakee2e904f1998-03-10 23:23:05 +0000141}
142
Fred Drake12f842e1998-04-17 02:52:12 +0000143build_dvi() {
144 use_latex $1 latex
Fred Drakee2e904f1998-03-10 23:23:05 +0000145}
146
147build_pdf() {
Fred Drake12f842e1998-04-17 02:52:12 +0000148 use_latex $1 pdflatex
149}
150
151build_ps() {
Fred Drake79842561998-04-17 20:06:16 +0000152 dvips -N0 -o $1.ps $1 || exit $?
Fred Drake12f842e1998-04-17 02:52:12 +0000153}
154
Fred Drake9940bd71998-08-06 20:15:20 +0000155build_text() {
156 lynx -nolist -dump $2/index.html >$1.txt
157}
158
Fred Drake11300cc1998-08-05 04:48:18 +0000159l2hoption() {
160 if [ "$2" ] ; then
Fred Drakeca6d6351998-11-30 20:30:26 +0000161 VALUE=`echo "$2" | sed 's/[$"@]/\\\\&/g'`
162 echo "\$$1 = \"$VALUE\";" >>$L2H_AUX_INIT_FILE
Fred Drake11300cc1998-08-05 04:48:18 +0000163 fi
164}
165
Fred Drake12f842e1998-04-17 02:52:12 +0000166cleanup() {
Fred Drake8cab5491998-07-23 19:13:52 +0000167 rm -f $1.aux $1.log $1.out $1.toc $1.bkm $1.idx $1.ilg $1.ind $1.syn
Fred Drakec9b8a571998-04-29 21:28:25 +0000168 rm -f mod$1.idx mod$1.ilg mod$1.ind
Fred Drake12f842e1998-04-17 02:52:12 +0000169 if [ ! "$BUILD_DVI" ] ; then
Fred Drake19c7c841998-05-07 21:20:39 +0000170 rm -f $1.dvi
Fred Drakee2e904f1998-03-10 23:23:05 +0000171 fi
Fred Drake9940bd71998-08-06 20:15:20 +0000172 rm -rf $1.temp-html
Fred Drake8dbf46a1998-05-15 17:13:08 +0000173 rm -f $1/IMG* $1/*.pl $1/WARNINGS $1/index.dat $1/modindex.dat
Fred Drake566b6d51998-10-27 21:59:03 +0000174 # bibtex stuff
175 rm -f $1.bbl $1.blg
Fred Drakee2e904f1998-03-10 23:23:05 +0000176}
177
Fred Drakee1feb8f1998-08-28 20:21:04 +0000178parse_option() {
179 # When using a long option with a parameter separated by '=',
180 # generalize the parsing of the two:
181 OPTION="$1"
182 unset VALUE
183 STUFF=`echo "$1" | grep '^--[-a-zA-Z0-9]*='`
184 if [ "$STUFF" ] ; then
185 # This leaves OPTION=--option= and VALUE=value
186 OPTION=`echo "$STUFF" | sed 's/^\(--[-a-zA-Z0-9]*=\)\(.*\)$/\1/'`
187 VALUE=`echo "$STUFF" | sed 's/^\(--[-a-zA-Z0-9]*=\)\(.*\)$/\2/'`
188 fi
189}
190
Fred Drakee2e904f1998-03-10 23:23:05 +0000191# figure out what our targets are:
192while [ "$1" ] ; do
Fred Drakee1feb8f1998-08-28 20:21:04 +0000193 parse_option "$1"
194 case "$OPTION" in
Fred Drake9f6f0da1998-08-12 18:07:51 +0000195 --all|--al)
196 BUILD_PDF=true
197 BUILD_PS=true
198 BUILD_DVI=true
199 BUILD_HTML=true
200 BUILD_TEXT=true
201 USE_DEFAULT_FORMAT=false
202 shift 1
203 ;;
Fred Drakee2e904f1998-03-10 23:23:05 +0000204 --pdf|--pd)
205 BUILD_PDF=true
206 USE_DEFAULT_FORMAT=false
207 shift 1
208 ;;
Fred Drake88053541998-04-24 21:57:12 +0000209 --ps|--postscript|--postscrip|--postscri|--postscr|--postsc|--posts|--post|--pos|--po)
Fred Drakee2e904f1998-03-10 23:23:05 +0000210 BUILD_PS=true
211 USE_DEFAULT_FORMAT=false
212 shift 1
213 ;;
214 --dvi|--dv|--d)
215 BUILD_DVI=true
216 USE_DEFAULT_FORMAT=false
217 shift 1
218 ;;
Fred Drakeac8f91a1998-04-02 15:37:13 +0000219 --html|--htm|--ht)
Fred Drakee2e904f1998-03-10 23:23:05 +0000220 BUILD_HTML=true
221 USE_DEFAULT_FORMAT=false
222 shift 1
223 ;;
Fred Drake9940bd71998-08-06 20:15:20 +0000224 --text|--tex|--te|--t)
225 BUILD_TEXT=true
226 USE_DEFAULT_FORMAT=false
227 shift 1
228 ;;
Fred Drakeac8f91a1998-04-02 15:37:13 +0000229 -H|--help|--hel|--he)
230 usage 0
231 ;;
Fred Drake11300cc1998-08-05 04:48:18 +0000232 -i|--iconserver|--iconserve|--iconserv|--iconser|--iconse|--icons|--icon|--ico|--ic|--i)
233 ICONSERVER="$2"
234 shift 2
235 ;;
Fred Drakee1feb8f1998-08-28 20:21:04 +0000236 --iconserver=*|--iconserve=*|--iconserv=*|--iconser=*|--iconse=*|--icons=*|--icon=*|--ico=*|--ic=*|--i=*)
237 ICONSERVER="$VALUE"
238 shift 1
239 ;;
Fred Drake35049521998-05-11 19:04:06 +0000240 -a|--address|--addres|--addre|-addr|--add|--ad)
Fred Drakee2e904f1998-03-10 23:23:05 +0000241 ADDRESS="$2"
242 shift 2
243 ;;
Fred Drakee1feb8f1998-08-28 20:21:04 +0000244 --address=*|--addres=*|--addre=*|-addr=*|--add=*|--ad=*)
245 ADDRESS="$VALUE"
246 shift 1
247 ;;
Fred Drake35049521998-05-11 19:04:06 +0000248 --a4)
249 TEXINPUTS=$TOPDIR/paper-a4:$TEXINPUTS
250 shift 1
251 ;;
Fred Drake5d59d3d1999-02-15 16:27:42 +0000252 --l2h-config|--l2h-confi|--l2h-conf|--l2h-con|--l2h-co|--l2h-c|--l2h-|--l2h|--l2)
253 CONFIG_FILES="$CONFIG_FILES $2"
254 shift 2
255 ;;
Fred Draked5d473f1998-05-11 20:40:24 +0000256 --letter|--lette|--lett|--let|--le)
257 shift 1
258 ;;
Fred Drake88053541998-04-24 21:57:12 +0000259 --link|--lin|--li)
260 LINK="$2"
Fred Drakeac8f91a1998-04-02 15:37:13 +0000261 shift 2
262 ;;
Fred Drakee1feb8f1998-08-28 20:21:04 +0000263 --link=*|--lin=*|--li=*)
264 LINK="$VALUE"
265 shift 1
266 ;;
Fred Drake88053541998-04-24 21:57:12 +0000267 -s|--split|--spli|--spl|--sp|--s)
268 MAX_SPLIT_DEPTH="$2"
269 shift 2
270 ;;
Fred Drakee1feb8f1998-08-28 20:21:04 +0000271 --split=|--spli=|--spl=|--sp=|--s=)
272 MAX_SPLIT_DEPTH="$VALUE"
273 shift 1
274 ;;
Fred Drake88053541998-04-24 21:57:12 +0000275 -l|--logging|--loggin|--loggi|--logg|--log|--lo)
Fred Drakedbc879e1998-03-11 15:33:44 +0000276 LOGGING=true
277 shift 1
278 ;;
279 -D|--debugging|--debuggin|--debuggi|--debugg|--debug|--debu|--deb|--de)
280 DEBUGGING=true
281 shift 1
282 ;;
283 -k|--keep|--kee|--ke|--k)
284 DISCARD_TEMPS=''
285 shift 1
286 ;;
Fred Drakeac8f91a1998-04-02 15:37:13 +0000287 -q|--quiet|--quie|--qui|--qu|--q)
Fred Drake664b36f1998-03-11 15:41:21 +0000288 QUIET=true
289 shift 1
290 ;;
Fred Drake88053541998-04-24 21:57:12 +0000291 --)
Fred Drakec9b8a571998-04-29 21:28:25 +0000292 shift 1
Fred Drake88053541998-04-24 21:57:12 +0000293 break
294 ;;
Fred Drakee2e904f1998-03-10 23:23:05 +0000295 -*)
Fred Drakee1feb8f1998-08-28 20:21:04 +0000296 usage 2 "Unknown option: ${VALUE%=}"
Fred Drakee2e904f1998-03-10 23:23:05 +0000297 ;;
298 *)
299 break;;
300 esac
301done
302
303if [ $# = 0 ] ; then
Fred Drake9940bd71998-08-06 20:15:20 +0000304 # check for a single .tex file in .
305 COUNT=`ls -1 *.tex | wc -l | sed 's/[ ]//g'`
306 if [ "$COUNT" -eq 1 ] ; then
307 set -- `ls -1 *.tex`
Fred Drake9f6f0da1998-08-12 18:07:51 +0000308 elif [ "$COUNT" -gt 1 ] ; then
309 usage 2 "Could not deduce which file(s) to process as HOWTO documents."
Fred Drake9940bd71998-08-06 20:15:20 +0000310 else
Fred Drake9f6f0da1998-08-12 18:07:51 +0000311 usage 2 "No file to process."
Fred Drake9940bd71998-08-06 20:15:20 +0000312 fi
Fred Drakee2e904f1998-03-10 23:23:05 +0000313fi
314
315if [ $USE_DEFAULT_FORMAT = true ] ; then
316 eval "BUILD_$DEFAULT_FORMAT=true"
317fi
318
Fred Drake664b36f1998-03-11 15:41:21 +0000319if [ "$QUIET" ] ; then
320 exec >/dev/null
321fi
322
Fred Drake9940bd71998-08-06 20:15:20 +0000323if [ "$DEBUGGING" ] ; then
324 set -x
325fi
326
Fred Drake11300cc1998-08-05 04:48:18 +0000327echo '# auxillary init file for latex2html' >$L2H_AUX_INIT_FILE
Fred Drakea5de7301998-10-19 19:14:42 +0000328echo '# generated by mkhowto.sh -- do not edit' >>$L2H_AUX_INIT_FILE
Fred Drake5d59d3d1999-02-15 16:27:42 +0000329for FILE in XXX $CONFIG_FILES ; do
330 if [ ! "$FILE" = XXX ] ; then
331 cat >>$L2H_AUX_INIT_FILE $FILE
332 cat >>$L2H_AUX_INIT_FILE <<EOF
333
334print "\\ninitializing from file: $FILE";
335EOF
336 fi
337done
Fred Drakee1feb8f1998-08-28 20:21:04 +0000338if [ "$ICONSERVER" ] ; then
339 ICONSERVER="${ICONSERVER%/}"
340fi
Fred Drake11300cc1998-08-05 04:48:18 +0000341l2hoption ICONSERVER "$ICONSERVER"
342l2hoption ADDRESS "$ADDRESS"
343l2hoption MAX_LINK_DEPTH "$MAX_LINK_DEPTH"
344l2hoption MAX_SPLIT_DEPTH "$MAX_SPLIT_DEPTH"
345echo '1;' >>$L2H_AUX_INIT_FILE
Fred Drakef4fc4761998-05-14 20:03:14 +0000346
Fred Drakee2e904f1998-03-10 23:23:05 +0000347for FILE in $@ ; do
Fred Drakedf825a11998-05-14 20:36:49 +0000348 FILEDIR=`dirname $FILE`
Fred Drakee1feb8f1998-08-28 20:21:04 +0000349 FILE=`basename $FILE .tex`
Fred Drakef4fc4761998-05-14 20:03:14 +0000350 #
351 # Put the directory the .tex file is in is also the first directory in
352 # TEXINPUTS, to allow files there to override files in the common area.
353 #
Fred Drake11300cc1998-08-05 04:48:18 +0000354 TEXINPUTS=$FILEDIR:$TOPDIR/texinputs:$TEXINPUTS
Fred Drakef4fc4761998-05-14 20:03:14 +0000355 export TEXINPUTS
356 #
Fred Drakee2e904f1998-03-10 23:23:05 +0000357 if [ "$BUILD_DVI" -o "$BUILD_PS" ] ; then
Fred Drakedbc879e1998-03-11 15:33:44 +0000358 build_dvi $FILE 2>&1 | tee -a $LOGFILE
Fred Drake9940bd71998-08-06 20:15:20 +0000359 HAVE_TEMPS=true
Fred Drakee2e904f1998-03-10 23:23:05 +0000360 fi
361 if [ "$BUILD_PDF" ] ; then
Fred Drakedbc879e1998-03-11 15:33:44 +0000362 build_pdf $FILE 2>&1 | tee -a $LOGFILE
Fred Drake9940bd71998-08-06 20:15:20 +0000363 HAVE_TEMPS=true
Fred Drakee2e904f1998-03-10 23:23:05 +0000364 fi
365 if [ "$BUILD_PS" ] ; then
Fred Drakedbc879e1998-03-11 15:33:44 +0000366 build_ps $FILE 2>&1 | tee -a $LOGFILE
Fred Drakee2e904f1998-03-10 23:23:05 +0000367 fi
368 if [ "$BUILD_HTML" ] ; then
Fred Drake9940bd71998-08-06 20:15:20 +0000369 if [ ! "$HAVE_TEMPS" ] ; then
Fred Drakee2e904f1998-03-10 23:23:05 +0000370 # need to get aux file
Fred Drakedbc879e1998-03-11 15:33:44 +0000371 build_dvi $FILE 2>&1 | tee -a $LOGFILE
Fred Drake9940bd71998-08-06 20:15:20 +0000372 HAVE_TEMPS=true
Fred Drakee2e904f1998-03-10 23:23:05 +0000373 fi
Fred Drake9940bd71998-08-06 20:15:20 +0000374 build_html $FILE $FILE 2>&1 | tee -a $LOGFILE
Fred Drakea5de7301998-10-19 19:14:42 +0000375 if [ "$ICONSERVER" = "." ] ; then
376 cp $TOPDIR/icons/*.gif $FILE/
377 fi
Fred Drakee2e904f1998-03-10 23:23:05 +0000378 fi
Fred Drake9940bd71998-08-06 20:15:20 +0000379 if [ "$BUILD_TEXT" ] ; then
380 if [ ! "$HAVE_TEMPS" ] ; then
381 # need to get aux file
382 build_dvi $FILE 2>&1 | tee -a $LOGFILE
383 HAVE_TEMPS=true
384 fi
385 # this is why building text really has to be last:
386 if [ "$MAX_SPLIT_DEPTH" -ne 1 ] ; then
387 echo '# re-hack this file for --text:' >>$L2H_AUX_INIT_FILE
388 l2hoption MAX_SPLIT_DEPTH 1
389 echo '1;' >>$L2H_AUX_INIT_FILE
390 TEMPDIR=$FILE.temp-html
391 build_html $FILE $TEMPDIR 2>&1 | tee -a $LOGFILE
392 else
393 TEMPDIR=$FILE
394 fi
395 build_text $FILE $TEMPDIR 2>&1 | tee -a $LOGFILE
396 fi
397
Fred Drakedbc879e1998-03-11 15:33:44 +0000398 if [ "$DISCARD_TEMPS" ] ; then
Fred Drake12f842e1998-04-17 02:52:12 +0000399 cleanup $FILE 2>&1 | tee -a $LOGFILE
Fred Drakee2e904f1998-03-10 23:23:05 +0000400 fi
Fred Drake12f842e1998-04-17 02:52:12 +0000401 # keep the logfile around
Fred Drakedbc879e1998-03-11 15:33:44 +0000402 if [ "$LOGGING" ] ; then
403 cp $LOGFILE $FILE.how
404 fi
405 rm -f $LOGFILE
Fred Drakee2e904f1998-03-10 23:23:05 +0000406done
Fred Drake11300cc1998-08-05 04:48:18 +0000407
Fred Drakeb0b19001998-10-07 16:41:40 +0000408if [ ! "$DEBUGGING" ] ; then
409 rm -f $L2H_AUX_INIT_FILE
410fi