| delorie.com/archives/browse.cgi | search |
| Message-Id: | <200404211823.i3LINOU1020638@delorie.com> |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| X-Sent: | 21 Apr 2004 18:22:43 GMT |
| From: | "Abe Backus" <abraham AT backus DOT com> |
| To: | <cygwin AT cygwin DOT com> |
| Subject: | RE: how to get IP with a shell command? |
| Date: | Wed, 21 Apr 2004 11:22:41 -0700 |
| MIME-Version: | 1.0 |
| In-Reply-To: | <511817FBFD979747B7EF13AA7136E72D2D1368@si-mail07.de.bosch.com> |
| X-IsSubscribed: | yes |
I rely more on where I'm logging into when automating my DISPLAY variable...
I assume that the parsed output of ipconfig might be incorrect in some
instances (for instance when I VPN to work and ipconfig display more than
one IP). The output of "who am I" on the box you log into usually gives a
good address.
I put various if/else statements in my .bashrc and .cshrc on the boxes that
I log into that end up invoking this:
export DISPLAY=`who am i | sed -e 's/.*(\(.*\)).*/\1/'`:0.0
-Abe
-----Original Message-----
To set the environment variable DISPLAY for XFree I use the following
command
export DISPLAY=`\
ipconfig | grep 'IP-Adresse' | \
sed 's/\(.*: \)\([0-9][0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\)\(.*\)/\2/g'`:0.0
'IP-Adresse' must be replaced with the proper version according to you
language.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |