From d831ce32ccd61e63b77901020a8415fcaf9fae3c Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Wed, 9 Dec 2015 11:29:42 +0100 Subject: [PATCH] Script to run all days at once. --- runall.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 runall.sh diff --git a/runall.sh b/runall.sh new file mode 100755 index 0000000..40ba5fb --- /dev/null +++ b/runall.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +rundir() +{ + if hash pypy &> /dev/null; then + python=pypy + else + python=python + fi + + input="" + if [ -f $1/input.txt ]; then + input="$1/input.txt" + fi + + for i in $1/*.py; do + echo "$i" "$input" + $python "$i" "$input" + done +} + +for i in day-*; do + rundir $i +done