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

HTH
-- 
Anton Graham                            GPG ID: 0x18F78541
<[EMAIL PROTECTED]>                 RSA key available upon request
 
Don't try to outweird me, three-eyes.  I get stranger things than you free
with my breakfast cereal." 
  -- Zaphod Beeblebrox [Douglas Adams, "Hithiker's Guide to the Galaxy"]


Reply via email to