Created
March 25, 2023 08:33
-
-
Save nischalkumar/ffec18fbe632862732a1af4b1fd4eae9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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