[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnupg-users
Subject:    summary: decrypt stdin with passphrase in
From:       "Robert" <qg7l80202 () sneakemail ! com>
Date:       2003-06-25 20:32:28
[Download RAW message or body]

A great answer to this problem is Named Pipes.
UNIX systems tend to have "mknod" and/or "mkfifo" programs that can be
used to create Named Pipes.
Named Pipes (aka "FIFO"'s) look like files or size 0 bytes of type "p" (as
opposed to "-" or "d").

Write to the file via redirection (or even by using "cp") and the writing
process will go into a wait state until another process tries to read from
that file.
Then the waiting/writing process's output goes straight into the reading
process.
Thanks go to Steve Butler.
His script (once trimmed of a typo :-)  ) works quite nicely!
(I added the line to remove the named pipes at the end.)

#!/bin/ksh
rm /tmp/my_phrase /tmp/my_file
mknod /tmp/my_phrase p
mknod /tmp/my_file p
cat my_gpg_file > /tmp/my_file &
echo 'passphrase' > /tmp/my_phrase &
gpg --homedir $gnupg_home --passphrase-fd=3 --no-tty --decrypt \
  3< /tmp/my_phrase 1< /tmp/my_file
rm /tmp/my_phrase /tmp/my_file



_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic