Incoming from James Sinnamon: > > Is there a utility to simply return the IP address of an interface, say > eth1 or ppp0? I need something that works like: > > $ netutil eth0 > 144.133.251.117
#!/usr/bin/perl -w use strict; my ( $ip ); open ( IFC, "/sbin/ifconfig |" ) or die qq($0: failed opening ifconfig pipe. $!); while( <IFC> ) { if ( /P\-t\-P/ ) { ( undef, $ip ) = split( /:/ ); ( $ip, undef ) = split( / /, $ip ); print STDOUT "$ip"; last; } } close( IFC ); -- Any technology distinguishable from magic is insufficiently advanced. (*) http://www.spots.ab.ca/~keeling - - -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]