What about: $ gpg --batch --decrypt --status-fd 1 2>/dev/null \ | awk '/^\[GNUPG:\] ENC_TO / { print $3 }' -- Werner Koch at guug.de www.gnupg.org keyid 621CC013