Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Apr 2003 23:57:22 +0200
From:      "DJ Boris" <dj_boris@mail.ru>
To:        "freebsd-questions" <freebsd-questions@FreeBSD.ORG>
Subject:   extract IP address and feed it into a command
Message-ID:  <01de01c30dd1$5c5d4c10$6300a8c0@fmelectro.co.za>

next in thread | raw e-mail | index | archive | help
hi there,

I am running fBSD 4.7 release.

I need to extract my IP address which is dynamically assigned by my ISP and
feed it into a serialmail command

"maildirsmtp ~alias/pppdir alias-ppp- 1.2.3.4 `hostname` "

which is executed from my ppp.linkup.

I have to replace hostname with my dynamic IP.

I know that my IP always starts with zzz.zzz and if I run

"ifconfig | grep zzz.zzz"

I get

inet zzz.zzz.xxx.xxx --> yyy.yyy.yyy.yyy netmask nnnnnnnnnn

Is there a command or something else that I can use in order to get only the
IP starting with zzz.zzz up to the first space and how do I feed it into the
above command?

thanx
dj boris




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01de01c30dd1$5c5d4c10$6300a8c0>