排除空行,应该用$0吧
awk -F ':' 'BEGIN{count=0}$0!~/^$/{count++}END{print count}' passwd
awk -F ':' 'BEGIN{count=0}$0!~/^$/{count++}END{print count}' passwd
2017-05-26