I am using perl Expect to spawn a shell, run date and get its output .. I am not getting the full output of date

Here is the script, can someone tell me where am I going wrong ?

#!/usr/bin/perl
use Expect;
my $exp = Expect->spawn('bash');
print $exp->send("date\r");
$exp->expect(1);
my $str = $exp->after();
print "STR = '$str'\n";     # $str is not complete output of date
$exp->send("exit\r");
$exp->hard_close();
print "Bye\n";
exit 0;

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to