my $ref = $exp->send("$cmd\n"); sleep(1); $ref = $exp->expect(TIMEOUT, [ $shell_prompts ] ); if (!$ref){ $log->warn("Timeout received!"); return -1; } $output = $exp->exp_before(); $output =~ s/^.*\r\n(.*)/$1/;