I use a perl script to construct an expect script when I want to configure
port prompts:
#!/opt/bin/perl
$password = "PASSWD";
$pm = "pm.iag.net";
$pm_port = "8888";
print "#!/opt/bin/expect\n";
print "spawn telnet $pm $pm_port\n";
print "expect ogin:\n";
print "send !root\\r\n";
print "expect word:\n";
print "send $password\\r\n";
$i=0;
while ($i < 30) {
print "expect \">\"\n";
printf("send \"set s%d prompt (pm1-s%d) login: \\r\"\n", $i, $i);
$i++;
}
This spits the expect script out to the standard output, which I then
dump into a file and execute.
I suppose if I learned expect fully, this could be a single program.
Peace,
Mike
-- Mike Gogulski syadasti@iag.net Network Administrator syadasti@cat.net Internet Access Group Altamonte Springs, Florida, USA +1-407-786-1145 Work +1-407-672-2340 Other