Symmetric encryption in GnuPG2 exits with non-zero exit code (2) even though
ecryption itself proceeds correctly (text is encrypted well). Whenever one
tries to encrypt a text using a symmetric key in batchmode, the side effect is:
gpg: can't connect to the agent: Invalid value passed to IPC
gpg: problem with the agent: No agent running
And exit code is 2.
gpg2 --homedir ./.gnupg --batch --passphrase password --output encrypted.file
--cipher-algo 3DES --symmetric plaintext.file