I need to automatically enter input without having to type yes or a password. Trying to use Open2 but not getting it to work.
I need it to automatically enter 'yes' and the return to continue without any interaction. I've tried a number of variations.
Thanks.
Code:
#!/usr/bin/perl
use IPC::Open2;
$pid = open2(*READFROM, *WRITETO, "/tmp/Install.sh arg1");
print WRITETO "here's your input\n";
while ($output = <READFROM>){
if($output =~ m/The authenticity of host 'server.mydomain.org (1.2.3.4)' can't be established.
RSA key fingerprint is 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00.
Are you sure you want to continue connecting \(yes\/no\)\?/){
print WRITETO "yes\n";
}
}
close(WRITETO);
close(READFROM);
I need it to automatically enter 'yes' and the return to continue without any interaction. I've tried a number of variations.
Thanks.