Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created September 1, 2016 19:21
Show Gist options
  • Save zoffixznet/ec574e21aae6e86ac35211c3888a8cd7 to your computer and use it in GitHub Desktop.
Save zoffixznet/ec574e21aae6e86ac35211c3888a8cd7 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use 5.020;
use IO::Pty;
my $pty = IO::Pty->new;
chomp (my $pass = readline);
my $tty = $pty->ttyname;
unless ( fork ) {
$pty->make_slave_controlling_terminal;
exec "gpg --use-agent --armor -b foo.txt";
}
say $pty $pass;
sleep 3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment