: !/bin/sh #MOBDETaline = 13771|0409565413|Telstra|NATIONAL DIRECT|Sep 2002|23/09/2002|161700|MAIDSTONE|0438040981MNET|0438040981|P|117|0.81| cat getMOBDETalinetot.out | \ awk -F'|' -v "mobmobile=$1" '{ mobile = $2 callcost = $13 if ( mobile != mobmobile ) continue print $0 ctot += callcost } END { print "" print "ctot = " ctot }'