topinfo=$(top -b -d 1 0 | sed s/[,:]//g)
meminfo=$(echo "$topinfo" | grep "^Mem")
arcinfo=$(echo "$topinfo" | grep "^ARC")
swpinfo=$(echo "$topinfo" | perl -ne 'print $1 if /^Swap \w+ Total (\w+) Used/')
topinfo=$(top -b -d 1 0 | sed s/[,:]//g)
meminfo=$(echo "$topinfo" | grep "^Mem")
arcinfo=$(echo "$topinfo" | grep "^ARC")
swpinfo=$(echo "$topinfo" | perl -ne 'print $1 if /^Swap \w+ Total (\w+) Used/')