system 'cat temp3 | grep "hdlcppp" > hdlc1'; system "mv hdlc1 hdlc"; system 'cat hdlc | cut -d " " -f2-3 > hdlc1'; system "mv hdlc1 hdlc"; system 'cat hdlc | cut -d " " -f1 > hdlc1'; system 'cat hdlc | cut -d " " -f2 > hdlc2'; system "rm hdlcget"; open(HDCLGET, ">hdlcget"); print HDLCGET "\#\!\/usr\/local\/bin\/expect\n"; print HDLCGET "set timeout -1\n"; open(MYINPUTFILE, "hdlc1"); while() { my($line) = $_; chomp($line); print HDLCGET "spawn \ ssh $line\n"; print HDLCGET "expect \"assword: \"\n"; print HDLCGET "send \"password\\r\"\n"; print HDLCGET "expect \"#\"\n"; print HDLCGET "send \"terminal length 0\\r\"\n"; print HDLCGET "expect \"#\"\n"; open(MYINPUTFILE1, "hdlc2"); while() { my($line1) = $_; chomp($line1); print HDLCGET "show xconnect all | inc $line1\\r\"\nexpect \"#\"\n"; } } print HDLCGET "send \"exit\\r\"\n"; print HDLCGET "interact\n"; system "touch hdlcget"; system "chmod 777 hdlcget"; system "hdlcget >hdlc3";