1
0
mirror of https://github.com/limosek/zaf-plugins.git synced 2024-11-01 08:17:19 +01:00
limosek-zaf-plugins/process-info/cpu-get.sh

7 lines
191 B
Bash
Raw Normal View History

2016-03-24 09:59:29 +01:00
#!/bin/sh
TOTAL=0
for PROC in $(/bin/ps u -C $1 | /bin/grep -e '^$2' | /usr/bin/awk '{ print $$3 }'); do TOTAL=$(echo "$TOTAL $PROC" | /usr/bin/awk '{print $$1 + $$2}') ; done;
echo $TOTAL