pgp encryption

Hi

I have one script for doing the gpg encryption on linux.
The encrytion is doing fine when i am running the script from command prompt on linux

The same script when it is triggering from mainframe using sysopts option in NDM(connect direct) the encryption step in the shell script is failling with the error code 2

Can anybody help me out to understand why this is so.

/usr/local/bin/gpg --always-trust --output $v_pgp_file_name --recipient userid --encrypt $v_file_name

Thanks in advance

Arvind Maurya