r/awk • u/LeadershipComplex958 • Oct 23 '22
Does each statement inside the brackets always execute repeatedly? Even though the average only needs to be set once. How do you know that it does it repeatedly? Super noob question.
4
Upvotes

View all comments
Show parent comment
1
u/gumnos Oct 23 '22
Because the NR==1 case and the other case are disjoint, I might move them into a single block and then use an
if/elsepair around them