diff --git a/cs205_final_exam.sh b/cs205_final_exam.sh old mode 100644 new mode 100755 index 0befa75a..8dcbe1fa --- a/cs205_final_exam.sh +++ b/cs205_final_exam.sh @@ -8,4 +8,13 @@ # The "Avg." values should be calculated as mean values for the corresponding columns. # The spacing and header formatting should match the above formatting description exactly. # There should be a comment explaining the purpose of each line in your shell script. -# The data file will be passed in to the script as a positional parameter and will not necessarily be called pokemon.dat. However, you can assume that any file passed to this script will be formatted exactly the way pokemon.dat is formatted. +# The data file will be passed in to the script as a positional parameter and will not necessarily be called pokemon.dat. However, you can assume that any file passed to this script will be formatted exactly the way pokemon.dat is formatted + + +awk 'END{print "Total Pokemon:",NR-1}' $1 + +awk '{s+=$6}END{print "Avg. HP:",s/NR}' $1 + +awk '{attack+=$7}END{print "Avg. Attack:",attack/NR}' $1 + + diff --git a/screenshots/Screenshot from 2023-03-31 22-25-04.png b/screenshots/Screenshot from 2023-03-31 22-25-04.png new file mode 100644 index 00000000..1a0cb5dc Binary files /dev/null and b/screenshots/Screenshot from 2023-03-31 22-25-04.png differ