I WANT THIS OUTPUT TO BE WRITTEN INTO A FILE BUT IT IS NOT DOING THAT PLZ HELP ME OUT TO WORK WITH THIS..
#!/usr/bin/perl open(INFILE, "<server") or die("cannot open infile:\n$!"); open(OUTFILE,">ping_output") or die("cannot open infile:\n$!"); my @ip_array = <INFILE>; chomp(@ip_array); foreach(@ip_array) { if($_ =~ /\d+.\d+.\d+.\d+/) { print OUTFILE ("\n\n\n****pinging system: $`****\n\n "); print OUTFILE system("ping -i 5 -c 4 $&"); } }
In reply to ping with perl by varalaxmibbnl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |