So I have a shell script that is writing to a specific file. Within that file, there exists some lines in a format similar to
Time taken: 123.45 ms
I would like to find every instance of this specific line and find the mean of all of the times in this file.
Edit: So I am sometimes dynamically appending to a file, lets say sample.txt. The problem that I am having sometimes is that awk sometimes misses the last 1 or 2 instances of this format. I think that awk is trying to access the file and read it before the file is done writing and there is a data race somewhere. How can I avoid this in the future?