just execute the command
quota and check if it has the same output format.
Do not use grep|grep|awk chain or similar, it can be implemented in one:
Code:
quota -v $user | awk '/quotas/{next}/blocks/{next}{total+=$2} END {print total/1024}'
(not tested)