man awk
example:
Code:
awk -v totalclaims=$arg1 -v vendor=$arg2 -v vid=$arg5 -v numclaims=$1 \
'index($0,"H") == 6 && index($0,vid) == 58 {a = a + 1} \
END {printf " %s - hosp - %d\n", vendor, a / totalclaims * numclaims}' /etc/prod.stats
i think you should post programming related questions in the programming forum: