in reply to Re^2: Testing for live IP's
in thread Testing for live IP's

Actually, traceroute doesn't "return a lot", it returns 0 for success, and 1 for failure, like many programs. It does "output a lot", but that's easy to fix. See if this works for you:

#!/usr/bin/perl use strict; use warnings; # IP adress or hostname of the remote machine to test my $remote = "192.168.0.2"; if(system("traceroute $remote 1> /dev/null 2>&1")) { print "$remote is down\n"; } else { print "$remote is up\n"; } __END__

Replies are listed 'Best First'.
Re^4: Testing for live IP's
by Elijah_A (Novice) on Jul 30, 2004 at 09:00 UTC
    Does the 0 for success of traceroute means that it successfully executed the command? or does it mean that it found valid IP's? Sorry I'm new to traceroute.

    Thanks for fixing up the script, it takes too long to test though.