I doubt it. You'll be printing out to the STDOUT of your script, which has little to do with the STDIN of the pgp process, even assuming that it will let you. And I'm guessing that pgp will not even ask the question, as it has no controlling TTY to begin with. I guess there has to be a way to fake one, but I don't know how.