我偶然发现了这个问题,所以我想知道这怎么可能?
标准运行命令:
# zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14
info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000017"
sent: 1; skipped: 0; total: 1
好的,让我们尝试仅获得第一行:
# zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | head -1
sent: 1; skipped: 0; total: 1
那标准头呢?
# zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | head
sent: 1; skipped: 0; total: 1
反grep吗?sed?开球?!?!!?!!?
# zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | grep -v pero
sent: 1; skipped: 0; total: 1
# zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | sed 's/foo/bar/'
sent: 1; skipped: 0; total: 1
# zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 | tee
sent: 1; skipped: 0; total: 1
stderr到stdout?
# zabbix_sender -c zabbix_agentd.conf -k mmysql.QCInserts -o 14 2>&1 | tee
sent: 1; skipped: 0; total: 1
我真的很困惑
tee
什么?如果您跑步会zabix_sender <options> 2>&1 | head -1
怎样?