#!/bin/sh OUT=$(dstat -dD total --noheaders --noupdate --integer 1 1 | tail -n 1) # | sed -n 's/^\s*\([0-9]*[[:alpha:]]*\).*$/__\1___/p' READ=$(echo $OUT | sed -n 's/^\s*\([0-9]*[[:alpha:]]*\).*$/\1/p') WRITE=$(echo $OUT | sed -n 's/^\s*[0-9]*[[:alpha:]]*\s*\([0-9]*[[:alpha:]]*\)$/\1/p') outio() { local lc lc=$(echo "$1" | cut -c $((${#1}))) if [ $lc = "k" ]; then echo -n '' elif [ $lc = "B" ]; then echo -n '' elif [ $lc = "M" ]; then echo -n '' else echo -n '' fi echo -n "${1}" } outio "${READ}" echo -n ' | ' outio "${WRITE}" echo exit $?