develooper Front page | perl.beginners | Postings from January 2002

REGEXP Help on Linux

Thread Next
Daryl J. Hoyt
January 4, 2002 14:08
REGEXP Help on Linux
Message ID:
    I am trying to use the net::telnet module, and I keep timing out.  I
believe it is because I do not have the right prompt.  My prompt looks like
[sqa1@duke:~]$.  I do not know why this doesn't work: Prompt =>
'/\[$::username\@$::machine\]\$$/'.  Any help you can give me would be
greatly appreciated.


Daryl J. Hoyt

#!/usr/local/bin/perl -w
use strict;

use Net::Telnet ();

$::command = "p4 sync -f \$HOME/p4/eng/sqa/tools/...";
$::username = "sqa1";
$::passwd = "***";
$::machine = "sparky";

$::t = new Net::Telnet (Timeout => 30, Prompt =>
$::t->login($::username, $::passwd);
#@::lines = $::t->cmd("p4 sync -f
@::lines = $::t->cmd($::command);

print "<@::lines>\n";
print "\n";

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About