$task = tasklist /nh /fo csv$total = 0for($i=0; $i -lt $task.count; $i++){ $one = $task[ $i ].Split('"').replace(",","")[9].replace(" K","") $total = $total + ([int] $one)}echo ("Total mem usage:{0}MB" -f ($total / 1024))
:没有sed 和awk 就是麻烦。
本文共 295 字,大约阅读时间需要 1 分钟。
$task = tasklist /nh /fo csv$total = 0for($i=0; $i -lt $task.count; $i++){ $one = $task[ $i ].Split('"').replace(",","")[9].replace(" K","") $total = $total + ([int] $one)}echo ("Total mem usage:{0}MB" -f ($total / 1024))
:没有sed 和awk 就是麻烦。
转载于:https://www.cnblogs.com/iclodq/p/7281406.html