$ whmapi1 listaccts api.filter.enable=1 api.filter.a.field='suspended' api.filter.a.arg0='0' api.filter.a.type=eq | grep -E 'user:| diskused:' | tr '\n' ' ' | sed 's/diskused:/\n/g' | tail -n +2 | awk 'begin {}; {sum+=$1; printf("%s %s\n",$3,$1)} END {print sum}'
#!/bin/bash
inodes_warning_level=95000
inodes_error_level=100000
whmapi1 listaccts api.filter.enable=1 \
api.filter.a.field='inodesused' api.filter.a.arg0=$inodes_warning_level api.filter.a.type=gt \
api.filter.b.field='inodesused' api.filter.b.arg0=$inodes_error_level api.filter.b.type=lt \
| grep -E 'user:|inodesused:' | tr '\n' ' ' | sed 's/inodesused:/\n/g' | tail -n +2 | awk '{printf("%s:%s\n",$3,$1)}'