I have tried to replace that line 11 withdie "perl citrix-enum-apps-xml-PORT-STATE-SERVICE+IP-disk.pl <INPUT_FI +LE_ports> <INPUT_FILE_IP> <OUTPUT_FILE> " if $#ARGV < 2; open(F0, $ARGV[0]); open(F1, $ARGV[1]); open(F2, ">>$ARGV[2]"); $line_no=$line_stop=0; while (<F0>) { s/\r\n//; /^[0-9]+/; $line=$'; $line_no=$&; while (<F1> && $line_stop++ < $line_no) { s/\r\n//; } print F2 $_, "\t$line\n" if /[0-9]+\//; } close F0; close F1; close F2;
but nothing comes out what's wrong ? Remember I have already one input file openned F0 the idea of the script is to replace the line number (3 and 5 here) in port.txt input filewhile (<F1> && $line_stop++ < $line_no) { s/\r\n//;print $_; }
and get the IP corresponding to the nth ($line_stop) (3 and 5 here) IP by 1.0.131.74 and 1.0.138.1543 PORT state protocol 3 80/tcp closed http 3 443/tcp closed https 3 8080/tcp open http-proxy 5 80/tcp open http 5 443/tcp filtered https 5 8080/tcp filtered http-proxy
to produce1.0.129.197 1.0.131.49 1.0.131.74 1.0.138.143 1.0.138.154 1.0.139.72
any ideas ? thank's1.0.131.74 80/tcp closed http 1.0.131.74 443/tcp closed https 1.0.131.74 8080/tcp open http-proxy 1.0.138.154 80/tcp open http 1.0.138.154 443/tcp filtered https 1.0.138.154 8080/tcp filtered http-proxy
In reply to can't read the 2nd input file by perl_boy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |