Setting DISPLAY
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.