syntax for encrypting only the string passed in an argument

Brian Mearns mearns.b at
Fri Apr 17 13:18:59 CEST 2009

On Thu, Apr 16, 2009 at 3:38 AM, Incomex <incomex at> wrote:
> I want to be able to call a shell from within a development environment
> and pass a string of data to it to be de/en/crypted.  The idea would look
> like
> this:
> read from file "data.txt" line z and put it into variableY
> variablex = call shell(gpg -e -r Joe variableY)
> print variablex
> rem:  variableY is the plaintext, variablex is the returned cyphertext
> you can email me directly at incomex at
> thanks
> --
> View this message in context:
> Sent from the GnuPG - User mailing list archive at
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at

Does you "development environment" allow you to feed things to stdin?
Because that's how gpg would normally expect to receive the text, if
an input file is not specified. I don't know whether or not there's a
way to specify the text directly in an argument (seems very unlikely,
most plaintext would be difficult to escape for use on a command
line). Depending on how the shell function commands, you might be able
to do it directly from there, e.g., `cat myfile | gpg -e -r joe`.


Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from:

More information about the Gnupg-users mailing list