as a quick fix I use the the echo | awk commands to make several variables then add them up but this is ugly and not so clever.
conveniently the number of integers pulled from the file is known. Is there a nice way to do this for a known number of int? How about an unknown number?
Since you give no clue as to what your data looks like or what awk command you are using, a specific answer is not possible. But make your awk command smarter. awk can add numbers, so do all the arithemetic there.
The file which name is stored in $LOG_FILE contains
bc misstep (hi)............34
bc misstep (hello)..2
bc misstep (bye)......0
This information is repeated many times but I only want to use the last set. I would like to add up these three numbers. The following gives me the three numbers. How can I add them up?
set LOG_BC = `tail -n 17 $LOG_FILE | grep bc | awk 'BEGIN{FS="."} {print $NF}'`