• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting DISPLAY
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting DISPLAY


  • Subject: Setting DISPLAY
  • From: David Brown <email@hidden>
  • Date: Tue, 21 Jan 2003 18:43:42 -0800

On Wed, Jan 22, 2003 at 01:46:18AM +0100, Yves Pouplard wrote:
> On Tue, 21 Jan 2003 14:15:48 -0800, Michael wrote:
> > if you are using bash, it looks kinda like this:
> > if [ ! $?DISPLAY ] ; then
> >   DISPLAY=":0.0"
> > fi
>
> or:
>
> if [ ${#DISPLAY} -eq 0 ]; then
>   export DISPLAY=':0.0'
> fi
>
> which can also be shortened this way:
>
> [[ ${#DISPLAY} -eq 0 ]] && export DISPLAY=':0.0'

        : ${DISPLAY:=':0.0'}
   or if you want to be terse
        : ${DISPLAY:=:0.0}

is the standard way to do this in Bourne-type shells.

You'll then want to export it as the next line:

        export DISPLAY

so that it gets exported.

This also works with zsh, which is also included in Mac OSX.

Dave Brown
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe: http://www.lists.apple.com/mailman/listinfo/x11-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: x11-users digest, Vol 1 #65 - 18 msgs (From: Michael <email@hidden>)
 >Re: x11-users digest, Vol 1 #65 - 18 msgs (From: Yves Pouplard <email@hidden>)

  • Prev by Date: geometry question
  • Next by Date: Re: x11-users digest, Vol 1 #66 - 17 msgs
  • Previous by thread: Re: x11-users digest, Vol 1 #65 - 18 msgs
  • Next by thread: Preserving tcsh history between X11 xterms and Terminal.app
  • Index(es):
    • Date
    • Thread