I want to import a PGP public key into my keychain in a script, but I don't want it to write the contents to a file. Right now my script does this:
curl http://example.com/pgp-public-key -o /tmp/pgp && gpg --import /tmp/gpg
gpg --import knows two ways of operation: it can either read from a file (for example
gpg --import key.gpg) or -- if no file name is passed -- read from STDIN.
curl on the other hand will print the fetched document to STDOUT if no
-o parameter is given. Putting both together with a pipe will directly stream the results from
curl http://example.com/pgp-public-key | gpg --import