When I execute the following command I get an output like this:
$ 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
How can I verify using shell that the above output contains the string Good signature or Primary key fingerprint ?
I have used grep command like this but it's not returning the expected result.
$ gpg --verify awscliv2.deb | grep -iq 'Good signature'
$ echo $?
1
For a valid signed file with output as above echo $? should return 0 and otherwise 1. But it's returning 1 always.