#!/bin/bash # Save path the current path that will be used to store the results. BASE_PATH=$(pwd) # Enter in the directory passed as first parameter, then execute run and save the results in the file passed as second parameter cd $1 BENCH_NAME=$1 BENCH_TIME=`(/usr/bin/time -f "%e" ./run) 2>&1 > /dev/null | tail -1` echo "$BENCH_NAME $BENCH_TIME" >> $BASE_PATH/$2