gpg pipe to stdout breaks when there is a delay in piping output such as occurs
when you have to type in a keycode or password before proceeding so piping to a
command that has a sudo breaks it. In my case I was running:
gpg --output - --export-secret-key XXXXXXXX | cat pubkey.gpg | gpg --armor
--output keys.asc --symmetric --cipher-algo AES256
And got the output:
gpg: [stdout]: write error: Broken pipe
gpg: iobuf_flush failed on close: file write error
gpg: problem with the agent - disabling agent use
Actually (just testing) I found that this problem happened with the 'cat'
command in place and not without. Maybe it is something wrong with my syntax.
I'm reporting it anyway in case its a gnupg bug.