openpgp

I have to create a script that will automatically respond when I have to encrypt a file. I have tried in shell and bash, and even expect but can't get it to work. I really don't want to do it in perl. The problem is it keeps asking if I am sureif I want to use the key. How do I force it to encrypt without it asking the question?

The command I am using is:

gpg -e -r (email address) --openpgp (filename)

Only guessing - but did you try the --batch-mode and/or --yes command(s) mentioned in the according man page ...?