my $match = 'Do you want to unpack these archive files for processing? [Y/N]: '; #my $exp = Expect->spawn($command, $params) or die "Cannot spawn \n"; my $exp = Expect->spawn("/usr/bin/python /opt/vtools/Scripts/reportconsolidator.py /opt/vtools/Healthcheck/$dDate > /opt/vtools/HealthReport.out") or die "Cannot spawn \n"; unless ($exp->expect(3,'-re',$match)) {}; print $exp "$response1\r"; #unless ($exp->expect(3,"Do you want to unpack these archive files for processing? [Y/N]:")) {}; #print $exp "$response1\r"; #unless ($exp->expect(700,"Do you want to process these CDR files? [Y/N]: ")) {}; #print $exp "$response2\r"; #unless ($exp->expect(5,"Do you want to process these health summary files? [Y/N]: ")) {}; #print $exp "$response1\r"; $exp->soft_close();