Getting IP in a script

Deepak Saxena deepak@csociety.purdue.edu
Tue, 13 Mar 2001 10:34:58 -0700


for each $i which is an interface

/sbin/ifconfig eth$i | grep addr: | cut -f2 -d : | cut -f1 -d ' '

~Deepak

On Mar 13 2001, at 10:25, Alan Dayley was caught saying:
> 
> I have a linux box with multiple NICs.  It uses DHCP to get it's IP address
> for one of the network connections.  I would like a script (perl preferred,
> other fine) that will get the IP address assigned to a specific NIC.  I
> can't seem to find the answer online anywhere...
> 
> Alan
> 
> /------------------------------------------
> |Alan Dayley             www.adtron.com
> |Software Engineer       602-735-0300 x331
> |ADayley@adtron.com
> |
> |Adtron Corporation         
> |3710 E. University Drive, Suite 5
> |Phoenix, AZ  85034
> \-------------------------------------------
> 
> 
> _______________________________________________
> Plug-devel mailing list  -  Plug-devel@lists.PLUG.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-devel

-- 
Deepak Saxena - deepak@csociety.purdue.edu - phone://602.790.0500

Code Monkey, MontaVista Software, Inc. - THE Embedded Linux Experts

call me 'evil' call me 'tide is on your side' anything that you want
anybody knows you can conjure anything by the dark of the moon
  - Tori Amos, "Suede"