in reply to Re: Back in the saddle...
in thread Back in the saddle...
A slightly revised, but still broken script:
#!/usr/local/bin/perl -w use strict; my $ifconfig = `/usr/etc/ifconfig ec0`; print "$ifconfig\n"; $_ = $ifconfig; my ($junk, $ip_address) = /^(.*\n.*inet\w)(\d{1,3}\.\d{1,3}\.\d{1,3 +})/; print "$junk $ip_address\n";
Running this results in the following:
ROOT 164 tech_support_4 //devel# ./net_config.test
ec0: flags=410c43<UP,BROADCAST,RUNNING,FILTMULTI, MULTICAST,LINK0,IPALIAS>
inet 172.22.43.157 netmask 0xfffffc00 broadcast 172.22.43.255
Use of uninitialized value at ./net_config.test line 11.
Use of uninitialized value at ./net_config.test line 11.
(That ifconfig output is only on two lines on the system.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Back in the saddle...
by graff (Chancellor) on Apr 05, 2003 at 01:29 UTC |