<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.28.3">
</HEAD>
<BODY>
Here is a boiled down script buried in the bowels of a system which uploads data from pharmacies: <BR>
<BR>
<BLOCKQUOTE>
CMD="gpg --homedir $HOME_DIR/.gnupg --batch --passphrase-fd 3 --decrypt $HOLD 2> /tmp/gpg.err.$$ | /usr/local/bin/$PARSER 2>> $LOG_FILE"<BR>
eval "$CMD"<BR>
</BLOCKQUOTE>
<BR>
Which actually works. I cannot fathom how. The FM says it will read the passphrase from file descriptor 3. Uh...Stdin, Stdout, Stderr, There goes 0, 1, 2. uh, that would be a file defined within gpg? <BR>
<BR>
Well, it sorta works. If you wiggle it, or jiggle it, modify it various ways, it stops working and typically says "Bad passphrase". <BR>
<BR>
This:<BR>
<BLOCKQUOTE>
CMD="cat something-something-icanttellyou/k_file.asc | gpg --homedir $HOME_DIR/.gnupg --batch --passphrase-fd 0 --decrypt $HOLD 2> /tmp/gpg.err.$$ | /usr/local/bin/$PARSER 2>> $LOG_FILE"<BR>
eval "$CMD"<BR>
</BLOCKQUOTE>
<BR>
Does work reliably under various combinations. <BR>
<BR>
Maybe there is some magic about FD 3 here, but I'm not finding it. Something about gpg-agent? <BR>
<BR>
Neal Rhodes<BR>
MNOP Ltd
</BODY>
</HTML>