aboutsummaryrefslogtreecommitdiff
path: root/m/runmath.sh
blob: 21ad75b98b98f8f9ec335bd60a43f188fcd8e034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/bash

# Abort on errors
set -e

script=$1

if test -z "$script"; then
    echo "Usage:"
    echo "$0 <script.m>"
    exit 2
fi

error=$(basename $script .m).err
output=$(basename $script .m).out

rm -f $output

# Run Kranc to regenerate the code
: ${KRANCPATH=../../../../repos/Kranc}
${KRANCPATH}/Bin/kranc $script | tee $error
[ $PIPESTATUS -eq 0 ] || exit $PIPESTATUS

mv $error $output