How to automatically overwrite the output file when running `gpg` (i.e. without being prompted)? [closed]

Adding --batch --yes

Example:

gpg --batch --yes -u me@bbb.com -r "you@aaa.com" \
  --output "OUTPUTFILENAME.xls.pgp" -a -s -e "FILE.xls"

Complete example with passphrase file:

gpg --batch --yes --passphrase-fd 0 -u me@bbb.com -r "you@aaa.com" \
  --output "OUTPUTFILENAME.xls.pgp" -a -s -e "FILE.xls"< \
  passphrase.txt

Leave a Comment