This works to get the hostname. It is the following bit of code that does not work to translate that hostname into an ip address:$hostname = `hostname`; print "hostname is $hostname\n";
$source = `ypcat hosts | grep '$hostname$'`; $source =~ /\d+.\d+.\d+.\d/; print "source is $addr\n";
In reply to Re: Re: ip address get problem
by markd
in thread ip address get problem
by markd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |