Import all keys from signatures

Werner Koch wk at gnupg.org
Fri Mar 6 11:17:20 CET 2009


On Thu,  5 Mar 2009 15:28, dshaw at jabberwocky.com said:

> gpg --recv-keys `gpg --with-colons --list-sigs YOUR-KEY-ID-HERE |
> egrep '^sig' | cut -d: -f5 | uniq`

For keys with a lot of signatures you better do:

  gpg --with-colons --list-sigs YOUR-KEY-ID-HERE |  \
     egrep '^sig' | cut -d: -f5 | sort | uniq | xargs gpg --recv-keys 

This is because the number of arguments on the command line is limited.
On Gnu/Linux this limit is pretty large but on other systems if might be
just a few k.  

You can so the same with awk of course:

  gpg --with-colons --list-sigs YOUR-KEY-ID-HERE | \
     awk -F: '/^sig/ {print $5}' | sort -u | xargs gpg --recv-keys 

(I was a bit curious whether uniq is still required and found out that
 POSIX indeed requires sort to support the -u flag.)



Salam-Shalom,

   Werner


-- 
Die Gedanken sind frei.  Auschnahme regelt ein Bundeschgesetz.




More information about the Gnupg-users mailing list