|
Decrypt a GPG file through shell script
Hi,
I'm trying to decrypt a gpg file thorugh a shell script. But i' could'nt. My script is ,
-sh-3.1$ cat test_gpg.sh
#!/bin/ksh
echo " Hello, iam testing GPG"
gpg prabhu.txt.gpg <<EOF
prompt prabhu
EOF
exit 0
The file i'm trying to decrypt is prabhu.txt.gpg and my passphrase is "prabhu".
Can someone please help me on this ASAP.
---------- Post updated 07-03-09 at 06:37 PM ---------- Previous update was 07-02-09 at 08:51 PM ----------
Hi all,
Just sharing this for informative purpose.
My below script works succesfully.
#!/bin/ksh
### Fetching the password from file or database
pass_phrase=`cat radhas_pwd|awk '{print $1}'`
### Decrypting the encrypted file by passing the passphrase and the output file
gpg --passphrase $pass_phrase --output prabhu.txt --decrypt prabhu.txt.gpg
exit
|