changelog shortlog tags changeset files revisions annotate raw

doc/initial-data.sh

changeset 113: bc94df402ff0
parent:9ec7552139a4
author: Dmitry Dzhus <mail@sphinx.net.ru>
date: Fri Nov 16 19:08:52 2007 +0300 (13 months ago)
permissions: -rwxr-xr-x
description: Updated report to comply with source code changes introduced in rev 110.
1#!/bin/bash
2#
3# Provide `initial-data.tpl.tex` with necessary macro definitions
4# extracted from statement file.
5#
6# Usage:
7#
8# ./initial-data.sh STATEMENT-FILE
9#
10# Output is a LaTeX code ready for inclusion using `\input`.
11
12
13TEMPFILE=$(mktemp /tmp/docXXXXXX)
14
15# Strip out non-TeXish comments
16
17cat ${1} | grep -v "[ ]*;; .*" > ${TEMPFILE}
18
19# Extract numeric parameters
20
21RIGHTBOUND=$(cat ${TEMPFILE} | grep right-bound | \
22 sed -e "s/(define right-bound \(.*\))/\1/")
23
24NTEX=$(cat ${TEMPFILE} | grep ';;@ \$n(x)' | \
25 sed -e "s/;;@ //" | sed -e 's/^\$\(.*\)\$$/\1/g' | tr -d "\n")
26
27LABEL=$(basename ${1})"-initial-data"
28
29m4 --define="__NTEX"="${NTEX}" \
30 --define="__RIGHTBOUND"="${RIGHTBOUND}" \
31 --define="__LABEL"="${LABEL}" \
32 initial-data.tpl.tex