#!/bin/bash #磁盤空間測試 IP=` ifconfig eth0 | grep 'inet addr' | sed 's/Bcast.*//'| awk -F : '{print $2}'` SPACE=`df | awk '{print $5}'| sed -n '2,6p' | sed 's/%//'` for i in $SPACE do if [ $i -gt 80 ] then echo "The addr $IP have space is more than 80%" fi done ~