Werner Koch wk at
Tue Sep 30 08:44:47 CEST 2008

On Mon, 29 Sep 2008 22:17, nicholas.cole at said:

> Is there any way to correctly 'guess' the settings for the
> GPG_AGENT_INFO variable (for the case where gpg-agent has been called
> with --use-standard-socket)?

That is easy.  With --use-standard-socket the socket used is


unless GNUPGHOME is set in which case it is


The environment variable you want is thus


We do not actually need the PID, thus we set it to -1.  The trraling 1
is the protocol version (not checked, iirc).

If you don't use --use-standard-socket you can try to write a scripts
based on

  netstat -lx | awk '/\/S.gpg-agent$/ { print $8 }'

but you need to figure out whether this is the socket for the desired
user.  Maybe -lxp would be helpful.



Linux-Kongress 2008 + Hamburg + October 7-10 +

   Die Gedanken sind frei.  Auschnahme regelt ein Bundeschgesetz.

More information about the Gnupg-users mailing list