1 2 3 4 5 6 7
#!/bin/sh grep -Eo 'mul\([0-9]+,[0-9]+\)' input \ | awk 'BEGIN { FPAT = "[0-9]+" } { x += $1 * $2 } END { print x } '