要执行的脚本:
#! /bin/bash
gpg --recipient 025674861 --output test1.txt.gpg --encrypt test1.txt
if [ -f "test1.txt.gpg" ]; then
echo "test1.txt.gpg"
fi
执行后:
[user@webss shell]$ ./gpgEncryptFil
gpg: 51538612BA: There is no assurance this key belongs to the named user
pub 5168G/51538612BA 2016-04-21 XXX
Primary key fingerprint: XXXXX
Subkey fingerprint: XXXX
It is NOT certain that the key belongs to the person named
in the user ID. If you *really* know what you are doing,
you may answer the next question with yes.
Use this key anyway? (y/N)
怎样让脚本自动选择“y”,不用手动选。我需要java调用。
因需要选择,java调用脚本,不能正常执行。