> Submitted 01-Sep-00 by Sarang Lakare:
> > Whats the command to get IP address of u're machine? The only way I know of
> > is thru kppp when using modem... I am talking of dynamic IP addresses
> > here.. I want something which i can put in a script!
> 
> Assuming that you have only one network connection, i.e. a dialup without a
> lan, you can do:
> 
> /sbin/ifconfig | grep addr | grep -v 127.0.0.1 | awk '{print $2'}' | awk -F: '{print 
>$2}'
> 
> (That should be all one line.)

Small type after the $2' - should be just $2

When I tried it on mine, I also get the LAN IP for the same machine (firewall).
You can add ' | grep -v 192.168. ' after the 127.0.0.1 to remove that

Thanks... Dan.



Reply via email to