awk '{$NF="" ;print $0}' 如果需要分隔符可以这样:awk 'OFS="," {$NF="" ;print $0}'
awk '{if ($0!~/^$/) print $1}' filename
awk '/^$/{x++} END {print x}' slave_status