On 2007-08-23 17:31:03 -0400, Orestes leal wrote:
> ifconfig eth0 | grep inet | awk '{ print $2 }'
> 
> Where eth0 it's your first network card, and so on.

Note that the Linux kernel doesn't specify what is your first network
card (e.g. upgrading the kernel can change the names of your network
cards). It's better to use the MAC address to select the IP address.
Moreover your command gives garbage when the machine has IPv6 support
(grep ' inet ' is better).

-- 
Vincent Lefèvre <[EMAIL PROTECTED]> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to