The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to encrypt and decrypt a file laknar Shell Programming and Scripting 2 12-11-2007 08:18 AM
Encrypt and Decrypt script shary Shell Programming and Scripting 9 12-11-2007 08:11 AM
AWK script: decrypt text uses frequency analysis SerJel Shell Programming and Scripting 4 11-27-2007 03:16 AM
Decrypt Des file - then encrypt frustrated1 SUN Solaris 0 09-07-2006 05:38 PM
How to decrypt a file encrypted with vi? Gerry UNIX for Dummies Questions & Answers 1 04-22-2001 02:44 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-03-2009
apsprabhu apsprabhu is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 43
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
  #2 (permalink)  
Old 07-05-2009
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,932
Quote:
pass_phrase=`cat radhas_pwd|awk '{print $1}'`
UUOC
just this would do
Code:
pass_phrase=`awk '{print $1}' radhas_pwd`
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0