Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding my $DISPLAY programatically.



Robert's Objective-C program further qualifies those ports by using
"Xquartz" as the program name, and dp dropped me a note pointing out
that modern Macs may have multiple IP addresses, particularly with
Parallels or Fusion installed.  So here's an updated script:

#!/bin/sh

MYPORT=`lsof -i tcp:6000-6040 | grep "Xquartz.*${USER}.*IPv4.*(LISTEN)" | awk '{print substr($9, 3) - 6000}'`
MYIP=`ifconfig -a | grep 'inet.*broadcast' | head -1 | awk '{print $2}'`
echo ${MYIP}:${MYPORT}


Bill
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/x11-users/email@hidden

This email sent to email@hidden

References: 
 >Finding my $DISPLAY programatically. (From: Robert Tillyard <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: "Mark J. Reed" <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Robert Tillyard <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Jeremy Huddleston <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Bill Janssen <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Jeremy Huddleston <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Bill Janssen <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Jeremy Huddleston <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Bill Janssen <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Jeremy Huddleston <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Bill Janssen <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Bill Janssen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.