Update 2023-11-05 12:58 OpenBSD/amd64-x13
This commit is contained in:
parent
356d7e8bc3
commit
a06d18fb17
@ -1,15 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
for i in $@
|
||||
do
|
||||
|
||||
RES="$(ps -x -o "comm rsz" | grep -Ei "$i")"
|
||||
RES="$(ps -x -o "comm vsz" | grep -Ei "^$i ")"
|
||||
if [ ! -z "$RES" ]
|
||||
then
|
||||
echo "$RES" | xargs -n2 -I{} echo "Adding: {} KB"
|
||||
echo "$RES" | awk '{ sum=sum+$2; } END { printf("Summary: %.2f MB\n", sum/1024); }'
|
||||
TOTAL=$(( TOTAL + $(echo "$RES" | awk '{ sum=sum+$2; } END { printf("%d", sum); }') ))
|
||||
else
|
||||
echo "$@ not found."
|
||||
fi
|
||||
|
||||
done
|
||||
echo $TOTAL | awk '{ printf("Summary: %.2f MB\n", $1/1024); }'
|
||||
|
Loading…
Reference in New Issue
Block a user