print HDLCGET "\#\!\/usr\/local\/bin\/expect\n"; print HDLCGET "set timeout -1\n"; open(MYINPUTFILE, "hdlc2"); open(MYINPUTFILE1, "hdlc3"); while() { my($line) = $_; chomp($line); while() { my($line1) = $_; chomp($line1); print HDLCGET "spawn \ ssh $line\n"; print HDLCGET "expect \"assword: \"\n"; print HDLCGET "send \"$tacacspw\\r\"\n"; print HDLCGET "expect \"#\"\n"; print HDLCGET "send \"terminal length 0\\r\"\n"; print HDLCGET "expect \"#\"\n"; print HDLCGET "send \"show xconnect all | inc $line1\\r\"\nexpect \"#\"\n"; print HDLCGET "send \"exit\\r\"\n"; print HDLCGET "interact\n"; } } close(MYINPUTFILE); close(MYINPUTFILE1);