|
发表于 2003-12-5 19:54:08
|
显示全部楼层
#!/usr/bin/perl
$hostname = '';
$username = '';
$password = '';
use Net::Telnet();
$t = new Net::Telnet (Timeout => 10);
$t->open($hostname);#打开连接
$t->login($username, $password);#登陆
@lines = $t->cmd("ls");#执行命令
print @lines; |
|