this is a script that systematically pings every host on the network,
and writes the output to the screen. If the -n arg is specified, it
will also write to a disk. What's wrong with the syntax, especially
line 12?
#!/usr/bin/env perl
$x = 1;
$b = 0;
for ($x = 1; $x < 256; $x++) {
$a = `ping -q -c 1 192.168.1.$b`;
$b += 1;
print "192.168.1.$b ";
print $a;
$usage="ping.pl [-n]"
if ($arg = "-n") {$e = 0}
else {$e = 1}
if ($e = 1) {
open (LOG, ">>/perl/pinglog.txt";
print `date`;
print $a;
}
else {}
}
Am I doing my ifs correctly? Thanks,
mark
got root?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
- Re: Help getting scripts working... Mark VanMiddlesworth
- Re: Help getting scripts working... Wiggins d'Anconia
- Re: Help getting scripts working... Janek Schleicher
- Re: Help getting scripts working... John W. Krahn
- RE: Help getting scripts working... Bill Akins
- Re: Help getting scripts working... Lance
- Re: Help getting scripts working... R. Joseph Newton
- Re: Help getting scripts working... Rob Dixon
- Re: Help getting scripts working... Rob Dixon
- Re: Help getting scripts working... wiggins
- Re: Help getting scripts working... wiggins