I am running a gpg --verify
on a list of files that I am referencing from gpg_verify.txt
.
I want to track which passed, so that I can later download some files that have first passed my check.
Therefore, how can I capture whether/or not a particular file in my loop passed/failed so that I can log it into a different file, that I can later reference?
I want something like:
while read -r line;
do
gpg --verify $line
if(above output^ passes) then;
> passed_gpg.txt
else
> failed_gpg.txt
done < gpg_verify.txt
Here is example output when I just run:
while read -r line;
do
gpg --verify $line
done < gpg_verify.txt
Output:
gpg: Signature made Tue Feb 11 17:26:10 2020 UTC
gpg: using RSA key XXXXXXXXXXXX
gpg: Good signature from "Rando person (XXXXX Signing Key) <example@example.com>" [ultimate]