1)用tr命令
# grep -v "#" /etc/snmp/snmpd.conf |tr -s '\n'
2)用sed命令
# grep -v "#" /etc/snmp/snmpd.conf |sed '/^$/d'
3)用awk命令
# grep -v "#" /etc/snmp/snmpd.conf |awk '{if($0!="")print}'
4)用grep命令
# grep -v "#" /etc/snmp/snmpd.conf |grep -v "^$"
阅读(764) | 评论(0) | 转发(0) |