浏览代码

Allow custom interpreter in runall script

Taddeus Kroes 7 年之前
父节点
当前提交
86304d4d1d
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      runall.sh

+ 3 - 2
runall.sh

@@ -1,9 +1,10 @@
-#!/bin/bash
+#!/usr/bin/env bash
+interp=${1-python3}
 i=1
 i=1
 for f in *.py
 for f in *.py
 do
 do
     echo "-- problem $i -----------------------------------"
     echo "-- problem $i -----------------------------------"
-    cmd="`which time` -f 'elapsed: %E' ./$f"
+    cmd="`which time` -f 'elapsed: %E' $interp $f"
     if [ -e input/$i ]
     if [ -e input/$i ]
     then cmd+=" < input/$i"
     then cmd+=" < input/$i"
     fi
     fi