Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nischalkumar/ffec18fbe632862732a1af4b1fd4eae9 to your computer and use it in GitHub Desktop.
Save nischalkumar/ffec18fbe632862732a1af4b1fd4eae9 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "" > data_final.csv
for i in {1..5}; do
./waf --run "pa2 --exp=exp$i" | grep -E 'Throughput|Average_Flow_Time' > output
first_throughput=""
last_throughput=""
last_flow_time=""
#echo "$output" >> data_final.csv
first_throughput=""
last_throughput=""
last_flow_time=""
while read line
do
word=( $line )
if [[ "${word[0]}" == "Throughput:" ]]; then
last_throughput="${word[1]}"
fi
echo "Output $i: First TP - $first_throughput, Last TP - $last_throughput$"
echo "$i,$first_throughput,$last_throughput,$last_flow_time" >> data_final.csv
done < "output"
echo $last_throughput
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment