#!/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