Separate stdout and stderr

littleBrain naseer.t at
Wed Jun 24 07:37:03 CEST 2009

Hi All,

I am newbie to GPG. 
I have got an application where it uses the following command to decrypt GPG
encrypted messages.

/usr/local/bin/gpg --no-tty --passphrase-fd 0 -d /tmp/testXXXXXX.gpg

This often (at least rarely) returns an error. One such example is:

Decrypted message body
!     sprintf(prime_arg, "%s to %s", prime_arg1, prime_arg2);

   gpg: Signature made Fri May 25 13:11:36 2007 PDT using DSA key ID
gpg: Good signature from "Tom Yu <tlyu at>"
gpg: WARNING: message was not integrity protected
   ret.code = KADM5_OK;
      if (! CHANGEPW_SERVICE(rqstp)) {
--- 573,586 ----


And I see, error and the decrypted message (stdOut??)  is spewed out in the

I would like to separate these error messages to bottom of the message and
standard decrypted output to the top of the body.

Could someone please help me to use some command or a shell script to
achieve this?

Any help would be highly appreciated...

View this message in context:
Sent from the GnuPG - User mailing list archive at

More information about the Gnupg-users mailing list