0

当我执行以下命令时,我得到如下输出:

$ gpg --verify awscliv2.deb

gpg: Signature made Mon Nov 4 19:00:01 2019 PST
gpg: using RSA key FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C
gpg: Good signature from "AWS CLI Team <aws-cli@amazon.com>" [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: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C

如何使用 shell 验证上述输出是否包含字符串Good signaturePrimary key指纹

我已经使用了这样的 grep 命令,但它没有返回预期的结果。

$ gpg --verify awscliv2.deb | grep -iq 'Good signature'
$ echo $?
1

对于具有上述输出的有效签名文件echo $? 应该返回 0,否则返回 1。但它总是返回 1。

4

0 回答 0