summaryrefslogtreecommitdiff
path: root/bin/run.sh
diff options
context:
space:
mode:
authorTom Harley2020-01-23 13:03:25 +0000
committerTom Harley2020-01-23 13:03:25 +0000
commitf3d375722130e448802c046af2d75f66a06de498 (patch)
tree0c82bd620be0401c6b9ba69c3314dfe0d9522eae /bin/run.sh
downloadmachinarium-master.tar.gz
machinarium-master.zip

Initial commit

HEADmaster
Diffstat (limited to 'bin/run.sh')
-rwxr-xr-xbin/run.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/run.sh b/bin/run.sh
new file mode 100755
index 0000000..d4765bb
--- /dev/null
+++ b/bin/run.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -e
+
+defs="${@:3}"
+dir=$(mktemp -d)
+trap "rm -rf $dir" EXIT
+
+s=$dir/solver.eprime
+p=$dir/problem.param
+cp $2 $p
+
+< $1 m4 $defs > $s
+
+savilerow -run-solver $s $p &> $p.log
+# infor=$(< $p.infor sed 's/ /,/g')
+# echo "$infor",'"'"$defs"'"'
+info=$(< $p.info awk -F ':' '{printf "%s,", $2}')
+echo '"'"$2"'"',"$info"'"'"$defs"'"'