I'm using php to invoke gpg, but I'm getting a pipe error. I thought that if I read in the password from a file, I could then pipe it to the command itself? But, I keep getting: Syntax error: "|" unexpected
Here's the code:
(Note: The files are being iterated over in a foreach loop...)
foreach($files as $k => $v) {
$encrypted = $v;
$filename = explode('.',$v);
$decrypted = $filename[0].'.txt';
shell_exec("echo $passphrase | gpg --no-tty --passphrase-fd 0 -o $decrypted -d $encrypted");
}