gpg return value problem

Mark Ivs markivs2003 at yahoo.com
Mon Jan 31 00:35:51 CET 2005


Thanks a lot for the response. 

Since I am using perl I tried the following...

gpg --recipient "XXX" --output bla-bla-bla
$errorval=$?;
print $errorval;

When there is an error, it prints 512. When the
encryption is successful it prints 0. That's great. I
was trying to find out more documentation about error
codes. But couldn't find anything.

I intentionally mis-spelled receipient or output or
recipient name but always got 512 error code. I was
assuming I will get different error codes. Is this the
correct behaviour or am I missing something?

Can someone please explain? Thanks a lot in advance.

-Mark

--- Ivan Boldyrev
<boldyrev+nospam at cgitftp.uiggm.nsc.ru> wrote:

> 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.
> 
> 
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 



		
__________________________________ 
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 



More information about the Gnupg-users mailing list