awkがこれら2つのタスクを実行するのはなぜですか?

awkがこれら2つのタスクを実行するのはなぜですか?

コマンドを実行するとき:

awk '/from/ {print $7} /to/ { print $7}' erroMuitoDoido.txt

ファイルは次のとおりです

May 19 04:44:43 server postfix/smtpd[32595]: CDAB515013: client=servidor.dominio.com.br[10.10.10.44]
May 19 04:44:43 server postfix/cleanup[18651]: CDAB515013: message-id=<[email protected]>
May 19 04:44:43 server postfix/qmgr[16684]: CDAB515013: [email protected], size=19590, nrcpt=1 (queue active)
May 19 04:44:50 server postfix/pipe[32596]: CDAB515013: [email protected], relay=dovecot, delay=6.2, delays=0.02/6/0/0.14, dsn=2.0.0, status=sent (delivered via dovecot service)
May 19 04:44:50 server postfix/qmgr[16684]: CDAB515013: removed

出力は次のとおりです

[email protected],
[email protected],
[email protected],

問題は「というラインだ。[Eメール保護]、"が2回表示されます。この問題をどのように解決できますか?

AWKバージョン:GNU Awk 4.0.0
オペレーティングシステム:Debian 6、OpenSuse 12.1、CentOS 6.2

ベストアンサー1

$ awk '/from=/ {print $7} /to=/ { print $7}' erroMuitoDoido.txt

なぜなら:

[email protected],
              ^^
              ^^

おすすめ記事