为什么 GPG 命令不允许我对输出进行 grep 或将其输出写入文件?

问题描述 投票:0回答:0

假设我想在此命令的输出中找到“AE09”,并突出显示该行(经典)。

~/Downloads$ gpg --verify sha256sum.txt.gpg sha256sum.txt
    gpg: Signature made Sun 18 Dec 2022 12:54:36 GMT
    gpg:                using RSA key 27DEB15644C6B3CF3BD7D291300F846BA25BAE09
    gpg: Good signature from "Linux Mint ISO Signing Key <[email protected]>" [unknown]
    gpg: WARNING: This key is not certified with a trusted signature!
    gpg:          There is no indication that the signature belongs to the owner.
    Primary key fingerprint: 27DE B156 44C6 B3CF 3BD7  D291 300F 846B A25B AE09

所以我尝试:

~/Downloads$ gpg --verify sha256sum.txt.gpg sha256sum.txt | grep "AE09"
gpg: Signature made Sun 18 Dec 2022 12:54:36 GMT
gpg:                using RSA key 27DEB15644C6B3CF3BD7D291300F846BA25BAE09
gpg: Good signature from "Linux Mint ISO Signing Key <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 27DE B156 44C6 B3CF 3BD7  D291 300F 846B A25B AE09

给我整个输出而不是“主键”行。

然后我尝试(稍后grep):

~/Downloads$ gpg --verify sha256sum.txt.gpg sha256sum.txt > res

留下空文件资源。

然后我尝试使用工具输出:

~/Downloads$ gpg --output res --verify sha256sum.txt.gpg sha256sum.txt
gpg: Signature made Sun 18 Dec 2022 12:54:36 GMT
gpg:                using RSA key 27DEB15644C6B3CF3BD7D291300F846BA25BAE09
gpg: Good signature from "Linux Mint ISO Signing Key <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 27DE B156 44C6 B3CF 3BD7  D291 300F 846B A25B AE09

然后我来这里是因为想法已经用尽了。我的想法是该命令不只是有标准输出,只是在内部打印数据?

谢谢,

bash io-redirection stderr
© www.soinside.com 2019 - 2024. All rights reserved.