> Danny wrote:
> > Hi list,
> > 
> > I am trying to get the ip address from each of my NIC's (only the ip 
> > address) from ifconfig and then
> > mailing the addresses to a remote mailbox. The problem is that I am making 
> > one BIG
> > stuff-up out of it and I am too embarrassed to post my script here. The 
> > more I
> > try, the harder it seems to get, and the more I get confused.
> > 
> Danny
> 
> Can I suggest something like - I pinched this a while back from someone:
> 
> $ perl -le '/inet (?:addr:)?(\S+)/
> and $1 ne "127.0.0.1" and push @a,$1 foreach `ifconfig -a`; print "@a"'
> 
> Pipe the output to mail or the like.
>

Thank you. It is exactly what I was looking for.

Danny

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to