summaryrefslogtreecommitdiffstats
path: root/bin/mem.sh
blob: decc2fd28fccd37da6e4928300343954734e52c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

AWKS='/MemTotal/   {mtotal=$2};
/MemFree/    {mfree=$2};
/Active/     {mactive=$2};
/^Cached/     {mcached=$2};
/SwapTotal/  {swtotal=$2};
/SwapFree/   {swfree=$2};
END {
    print mtotal-mfree " " mtotal;
    print mactive " " mtotal;
    print mcached " " mtotal;
    print swtotal-swfree " " swtotal; }'

echo "$AWKS"
#while echo ' ^tw()Mem:
#Active:
#Cached:
#Swap  : ' | paste -d ' ' - < (awk "$AWKS" /proc/meminfo | gdbar -fg '#aecf96' -bg '#37383a' -w 50 -h 7); do
#sleep 5
#done