$SUM += /$regex/; #### nawk '/([0-9]*)/{tot+=$1}END{print tot}' file