Update 2023-11-05 12:58 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id 2023-11-05 12:58:38 +01:00
parent 356d7e8bc3
commit a06d18fb17

View File

@ -1,15 +1,13 @@
#!/bin/sh #!/bin/sh
for i in $@ for i in $@
do do
RES="$(ps -x -o "comm vsz" | grep -Ei "^$i ")"
RES="$(ps -x -o "comm rsz" | grep -Ei "$i")"
if [ ! -z "$RES" ] if [ ! -z "$RES" ]
then then
echo "$RES" | xargs -n2 -I{} echo "Adding: {} KB" 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 else
echo "$@ not found." echo "$@ not found."
fi fi
done done
echo $TOTAL | awk '{ printf("Summary: %.2f MB\n", $1/1024); }'