-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

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.

Regards

James Turnbull


- --
James Turnbull <[EMAIL PROTECTED]>
- ---
Author of Pro Nagios 2.0
(http://www.amazon.com/gp/product/1590596099/)

Hardening Linux
(http://www.amazon.com/gp/product/1590594444/)
- ---
PGP Key (http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x0C42DF40)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFEjXue9hTGvAxC30ARA/8OAJ0X+B9/7Bk69YYNTQdJtQnQPV7+TwCfUAyf
8p4kaBmTCdfpsCvs6uQbTpI=
=uKMy
-----END PGP SIGNATURE-----

-- 
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