gpg return value problem

Ivan Boldyrev boldyrev+nospam at cgitftp.uiggm.nsc.ru
Fri Jan 28 07:23:59 CET 2005


On 9003 day of my life Mark Ivs wrote:
> Hello,
> I am trying to capture the return value from the gpg
> command. Documentation says, gpg will return 0 if
> successful or return 1 if there's an error.
>
> $errorval = 0;
> $errorval = 'gpg --recipient "XXX" --output
> $rootpath\\output\\$filepgp --encrypt
> $rootpath\\encrypted\\$file';

gpg --recipient "XXX" --output bla-bla-bla
erroroval=$?
echo $errorval

Returned value is stored by shell in variable '$?'.  And when you
assign to variable, don't prepend its name with dollar sign.

-- 
Ivan Boldyrev

                        Today is the first day of the rest of your life.




More information about the Gnupg-users mailing list