#!/bin/bash algos="baseline tool1 tool2 tool3 v1tool v2tool v3tool v4tool v5tool" #algos="v1tool" models="2 4 5" sizes="1 2 4 8 16" cycle=1 for algo in $algos; do for model in $models;do for size in $sizes;do gm=$model"_"$size resfn=$HOME"/bin/"$algo"model"$gm".txt" for run in `seq 10 `;do if [ $run -eq 1 ]; then echo "Algorithm,Model,Run,Cost,Attainment" > $resfn fi if [ $[$cycle % 2] -eq 0 ]; then /usr/bin/time -f %U -a -o $resfn".time" $HOME/bin/$gm/$algo | gawk -F, -v OFS="," -v RUN=$run -v ALGO=$algo -v GM=$gm '!/^m/&&NF>3{costpos=NF-1;print ALGO,GM,RUN,$costpos,$NF}' >> $resfn & else /usr/bin/time -f %U -a -o $resfn".time" $HOME/bin/$gm/$algo | gawk -F, -v OFS="," -v RUN=$run -v ALGO=$algo -v GM=$gm '!/^m/&&NF>3{costpos=NF-1;print ALGO,GM,RUN,$costpos,$NF}' >> $resfn fi cycle=$[$cycle + 1] done done done done