Try and grep out the information you need from the command /sbin/ifconfig.

If you're root, all you need is ifconfig, since it's in your path name, however any 
other
user, ifconfig is not.  But that command will give you a lot of info, one of which is 
the
IP address. 

Something like the following command should give you the IP address.

/sbin/ifconfig eth0 | grep inet | cut -d ":" -f 2 | cut -d " " -f 1

Since it sounds like you're using a dial-up account, you'll substitue eth0 for ppp0.  
(I
think that's what it's called, been a long time since I've dialed in.  Just run the
ifconfig command when your dialed in to see what it looks like.)

But that command will weed out just the IP Address and print it out for you.
tdh

--
T. Holmes
-----------------
UNIXTECHS.org
[EMAIL PROTECTED]
-----------------
"Real Men Us Vi!"




| Hi,
| I'm trying to write a bash script which needs the current IP address that I 
| have been assigned by my ISp at any particular moment. How can I do this?
| 
| TIA,
| 
| Jord
| 
  ------------------------------------------------------------------ 

Reply via email to