Another idea I was considering was to just leave everytihng in the original file (hdlc) and then write the script so it uses field one of "$line" for the first input and field two for the second, but I have yet to figure out how to get that to work as well.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(<MYINPUTFILE>) { 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(<MYINPUTFILE1>) { 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";
In reply to using multiple input files by ddrew78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |