I don't quite understand what you are trying to do. In the first code fragment you are doing something with gpg (don't know what it is, it depends on the --option) and in the second fragment you are reading the contents of a file.
Can you reword this?
That said, you might be interested in gpg's --passphrase-fd option. It allows you to supply the passphrase to gpg over a pipe, and without disturbing any of the stdio channels. It is the most secure option for passing a passphrase to gpg other than letting gpg prompt for it by itself.
In reply to Re: using a pipe
by Celada
in thread using a pipe
by drock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |