-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paul Lussier said:
>
> In a message dated: Wed, 24 Oct 2001 13:03:01 EDT
> Benjamin Scott said:
>
> >ifconfig $IFACE | perl -ne 'print "$1\n" if m/inet addr:([0-9.]*)/;'
> >
> > (or something like it) is what I usually use.
>
> Or another variation on the same theme without the overhead of perl:
>
> ifconfig eth0 | grep inet | awk -F: '{print $2}' | cut -f1 -d' '
>
In the Unix tradition of there being more than one way to do a thing,
this is what I use in my firewall script:
OUTSIDE_IP=`ifconfig eth1 |grep "inet addr" | cut -d':' -f2 |cut -d' ' -f 1`
Which is really not very different from Paul's method... I just
prefer to avoid AWK whenever possible. =8^)
- --
Derek Martin
Senior System Administrator
Mission Critical Linux
[EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE71wcPdjdlQoHP510RAioKAJ9fzSB/moAblCEsgTWn9nRijvOPYwCfTPyR
ky1vaT+/RqaWw6PJ3v+e3ZU=
=7T7p
-----END PGP SIGNATURE-----
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************