引用shell变量

year=`date +%Y`

month=`date |awk '{print $2}'`

awk -v y=$year -v m=$month 'BEGIN{FS="/";i=0}2==m&&$3==y{i++;$1=9999}END{print i}' $logpath



获取倒数第二个值

df -h  | egrep '/$' | awk  '{print $(NF-2)}'