reading a passphrase out of an environment variable

David Shaw dshaw at jabberwocky.com
Thu Jun 28 13:41:39 CEST 2007


On Thu, Jun 28, 2007 at 04:06:55AM -0400, Ken Takusagawa wrote:

> If we had a feature of reading a passphrase out of an environment
> variable, one could write a script along these lines
> 
> #! /bin/bash
> read -s GNUPG_PASSPHRASE
> # -s is a bash-special option to read that does not echo
> 
> #multiple invocations of gpg that use the same passphrase
> for file in *.gpg
> do gpg --get-passphrase-from-environment ...
> done
> ...
> unset GNUPG_PASSPHRASE

This doesn't fully answer your question, I know, but have you looked
at --multifile to accomplish this?

  gpg --multifile --decrypt *.gpg

David



More information about the Gnupg-devel mailing list