[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: IP Address Variable?
- From: "Joe Giles" <jgiles joeman1 com>
- To: redhat-list redhat com, redhat-list redhat com
- Subject: Re: IP Address Variable?
- Date: Wed Jul 31 13:03:29 2002
Worked Like a charm... Thanks man...
Joe
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Tuesday 30 July 2002 10:37 pm, Joe Giles wrote:
> > Is there a preset variable in Linux that stores your IP address?
> >
> > I use DHCP, and I would like to use an IP variable (If one exists) to
> > set my DISPLAY option... Can anyone help ?
> >
> > Example
> >
> > display=$MYIP:0;export display
> >
> > There $MYIP would be the actual Linux variable to export...
>
> Not that I am aware of, but obtaining the info and exporting it is easy
> enough. Probably lots of better ways, but this should do it:
>
> display=`/sbin/ifconfig eth0 | grep "inet addr" | cut -d : -f 2 |
> cut -d " " -f 1`; export display
>
> Obviously, adjust "eth0" to suit the device in question.
>
> - --
> - -Michael
>
> pgp key: http://www.tuxfan.homeip.net:8080/gpgkey.txt
> Red Hat Linux 7.2 in 8M of RAM: http://www.rule-project.org/
> - --
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iEYEARECAAYFAj1HUS4ACgkQn/07WoAb/SsDxQCePSsHGz982qQxVJlRvko7J3pA
> IdgAnjZoPfn+1zT6REjY/8bdcmeLZUWJ
> =93Qi
> -----END PGP SIGNATURE-----
>
>
>
> --
> redhat-list mailing list
> Unsubscribe mailto:redhat-list-request redhat com?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list
>
Joe Giles
jgiles joeman1 com
AOL ID: mcigiles
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]