标签: bash shell
我想根据CPU使用情况获得通知
#/bin/bash val=$( ps -eo pcpu| sort -r -k1 | awk '{ if(NR>1) sum +=$1 } END{print sum}') req="50" echo $val echo $req if [ $var > $req ] then notify-send "cpu uses is higher" fi