beginner to gnupg

Werner Koch wk at
Tue Oct 30 17:58:46 CET 2007

On Tue, 30 Oct 2007 15:40, rjh at said:

> Note that it's "--armor --export", not "--export --armor".  The former
> will work fine.  The latter will try to export a key named "--armor",

That is not correct.  The ordering of options and commands does not
matter.  However mixing arguments ("key name") and options/commands does
not work as soon as the first non-option/command has been detected all
following items are considered arguments.

There is one caveat: If the first argument start with a dash it will be
viewed as an option.  To avoid this the sepcial option "--" may be used
which explicitly declares that all waht follows are arguments.

Note that some options have option-arguments, e.g.

 gpg -r Alice -r Bob --encrypt file.txt

Here Alice and Bob are arguments of the -r option.  -r (or --recipient)
requires an option and thus gpg expects this.  As an alternative you may

 gpg --recipient=Alice --recipient=Bob --encrypt file.txt

And in scripts you would use

 gpg --recipient=Alice --recipient=Bob --encrypt -- $FILE

so that you can even encrypt files with names like '--armor'.



Die Gedanken sind frei.  Auschnahme regelt ein Bundeschgesetz.

More information about the Gnupg-users mailing list