OK thanks to Zentara, my code now looks like...
#!/usr/bin/perl
use warnings;
use strict;
use IPC::Open3;
local $SIG{CHLD} = 'IGNORE';
local $SIG{PIPE} = 'IGNORE';
my $childpid = open3(\*IN, \*OUT, \*ERR, 'gpg --no-greeting --no-tty
--command-fd 0 --status-fd 1 --edit root');
print IN "tru
zentara wrote:
On Wed, 08 Jun 2005 09:24:43 +0100, [EMAIL PROTECTED] (D. J. Birkett)
wrote:
Thomas Bätzler wrote:
D. J. Birkett <[EMAIL PROTECTED]> asked:
OK I've tried altering my code as you suggested, replacing
the regexes with ones that would work. gpg still just sits
there as soon as
Here is what I now have...
use IPC::Open3;
use strict;
use warnings;
before IPC::Open3
local(*HIS_IN, *HIS_OUT, *HIS_ERR);
$childpid = open3(*HIS_IN, *HIS_OUT, *HIS_ERR, 'gpg --edit root');
Make sure open3 worked
open3(...) or die $!;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
D. J. Birkett wrote:
> Thomas Bätzler wrote:
>
>> D. J. Birkett <[EMAIL PROTECTED]> asked:
>>
>>> OK I've tried altering my code as you suggested, replacing the
>>> regexes with ones that would work. gpg still just sits there as soon
>>> as it has entered it's intereactive mode, and perl doesn't
Zentara wrote:
Since you are not showing us your code, we can only guess.
My guess is that you are not setting up the gpg command properly.
Here is what I now have...
use IPC::Open3;
local(*HIS_IN, *HIS_OUT, *HIS_ERR);
$childpid = open3(*HIS_IN, *HIS_OUT, *HIS_ERR, 'gpg --edit root');
sle
Thomas Bätzler wrote:
D. J. Birkett <[EMAIL PROTECTED]> asked:
OK I've tried altering my code as you suggested, replacing
the regexes with ones that would work. gpg still just sits
there as soon as it has entered it's intereactive mode, and
perl doesn't seem to be passing any commands to it
D. J. Birkett <[EMAIL PROTECTED]> asked:
> OK I've tried altering my code as you suggested, replacing
> the regexes with ones that would work. gpg still just sits
> there as soon as it has entered it's intereactive mode, and
> perl doesn't seem to be passing any commands to it at all.
>
> Any
Zentara wrote:
Something along these lines
print HIS_IN "trust\n";
chomp(my $answer = );
if( $answer =~ /^How many years?$/ )
{ print HIS_IN "5\n"; }else{print "years error $!\n"; exit}
chomp(my $answer1 = );
if( $answer1 =~ /^Are you sure?$/ )
{ print HIS_IN "yes\n"; }else{prin