$good = `grep -i $vals[0] $file | awk '{ print $2 }'` #### $good = `grep -i $vals[0] $file | awk -f myprint`