LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 05-10-2005, 01:54 PM   #1
Risc91
Member
 
Registered: Jan 2002
Location: Macomb, MI
Distribution: Ubuntu|Red Hat ES|AIX
Posts: 161

Rep: Reputation: 30
gpg from ksh script


I am trying to include some commands in a script to decrypt files in a specific directory. Obviously to decrypt a file you need to input the passphrase for the key. However, I don't know how to pass a passphrase to the "Enter passphrase:" prompt that is given after i call the gpg -d command.

Any suggestions?
 
Old 05-10-2005, 03:02 PM   #2
JurgyMan
Member
 
Registered: Jan 2004
Location: USA
Distribution: Gentoo
Posts: 60

Rep: Reputation: 15
Either use a blank passphrase.... or you could use expect.
Get it from here:

http://www-1.ibm.com/servers/aix/pro.../download.html
 
Old 05-11-2005, 10:45 AM   #3
Risc91
Member
 
Registered: Jan 2002
Location: Macomb, MI
Distribution: Ubuntu|Red Hat ES|AIX
Posts: 161

Original Poster
Rep: Reputation: 30
In the event that anyone ever needs to do this I found a solution. I just echo'd the $myPass variable and piped it to GPG. For GPG to pick it up I had to use the --passphrase-fd 0 option. This basically just tells GPG to pick up the passphrase from file descriptor 0.

Code:
echo $myPass | gpg --passphrase-fd 0 -d filename.gpg
You can then go a step further and define a file for the output to be sent to, but the solution is there.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ksh math script SeT Programming 10 10-13-2004 08:06 AM
ksh directory comparison script SeT Programming 4 08-30-2004 11:57 AM
Can somebody help me with a ksh script? twentymil AIX 7 01-21-2004 09:55 AM
ksh script problem pldobs Programming 2 12-24-2003 11:38 PM
KSH script AquamaN Programming 2 12-08-2003 11:34 AM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 10:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration