sub decrypt_key{ my $Ironkey = '/media/IronKey/linux/ironkey'; my $Ironkey_pwd = 'Enter your IronKey password: '; my $Ironkey_sucess = 'Unlock successful. '; my $Ironkey_badpw = 'password not accepted '; my $data = ($entry->get_text()); chomp($data); $entry->set_text(''); #sleep(2); $exp = Expect->spawn("$Ironkey") or die "Cannot Spawn"; #$exp->debug(3); #$exp->raw_pty(1); $exp->exp_internal(1); #$exp->log_stdout(0); $exp->expect(60, "$Ironkey_pwd"); $exp->send("$data\r"); #$data comes from the password box of the +GUI frontend ## I tried this way as well #$exp->expect(60, # [ qr/password:/ => sub{ $exp = shift; # $exp->send("$data\r\n"); # exp_continue; # }], # ); $exp->soft_close(); #system("nautilus"); Future use }
In reply to Re^2: Perl Expect
by dayhkr
in thread Perl Expect
by dayhkr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |