LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "Inforamtion about Enviroment variable DISPLAY" (https://www.linuxquestions.org/questions/linux-newbie-8/inforamtion-about-enviroment-variable-display-365193/)

sunsane 09-20-2005 07:57 AM

"Inforamtion about Enviroment variable DISPLAY"
 
Hi all,
I had some queries regarding environment variable DISPLAY->

1. What does 0.0 mean in while setting your environment variable as set DISPLAY w.x.y.z:0.0 ?
2. Why you need to set DISPLAY variable in UNIX/LINUX environmet always?
3. Is it always there that every device on linux network and having capability
of expressing Input/Output through GUI must have env. variable DISPLAY ?
4. Last but very silly question, why DISPLAY is ever put up as env. variable in
LINUX?

Help me out.

anyone having some written history on environment variables can list me out.

cheers

pats 09-20-2005 09:44 AM

ok so basically what the display vairiable tells you is where the xserver is going to push all the visual output.

the 0 refers to the display number. don't know why you've got 0.0 - i've never seen it declared like that and you probably don't need the second one

so x.y.z.p:0 would be fine.

ok the reason the display variable comes into play is not really on a local setup but if you ssh into a machine(server) you can set the display env var to point to the client that your ssh ing from. so you'd have somehting like this

set DISPLAY client_ip_address:0

sunsane 09-21-2005 05:42 AM

Dispaly variable
 
Hi pats,

Understood the point of pushing of all visual o/p. But then, what is display
number & really i saw people working here on their SPARC m/c s setting DISPLAY by w.x.y.z:0.0.

Also, why does a client need to set it's DISPLAY on server as pointed by you.
& then try to answer my queries no. 2,3,4.

Thanks

pats 09-21-2005 10:05 AM

Quote:

Also, why does a client need to set it's DISPLAY on server as pointed by you.
the client when logged on via ssh has to set the display env. var. on the server to point anything executed in that shell to be forwarded to the clients machine. so if you were just using a local shell you could set DISPLAY to be localhost:0.0 and it would make not impact because thats the notmal behaviour.

Quote:

really i saw people working here on their SPARC m/c s setting DISPLAY by w.x.y.z:0.0
i've never seen it done like this but i'll take your word for it. the first 0 is the display number for sure


Quote:

what is display
well. linux has 'virtual' displays. i'm not even going to attempt to explain this because it makes sense in my head but i can't put it into words!!

have a look at this tho http://support.objectplanet.com/esup..._i=22&type=yes

Quote:

Why you need to set DISPLAY variable in UNIX/LINUX environmet always?
don't know what you mean by this. sorry


Quote:

Is it always there that every device on linux network and having capability of expressing Input/Output through GUI must have env. variable DISPLAY ?
not necessarily. its not essential. for example i might want to log into a server and just execute a couple of copy commands. i wouldn't need to forward the xserver output to my own display in that case. only if you want to use X forwarding do you need to set the DISPLAY variable


Quote:

4. Last but very silly question, why DISPLAY is ever put up as env. variable in
errm. good question. i believe all the enviroment variables are loaded into memory and therefore more quickly accessible than being put in a config file.
if i was to log into a box somewhere on the net then set the DISPLAY variable to point back to me. you could then log in with the same account from a different account with a different ip address and set the DISPLAY enviroment variable to point back to you.
this would work because each session will have its own set of enviroment variables.
this means that we could both work on the same machine with no conflict.

not such a silly question after all!!

hope i've cleared some things up. i can't really explain the whole display number thing. when you use VNC you have to specify which display you want to connect to and its the same sort of thing

sunsane 09-22-2005 12:44 AM

Thanks pat,

all your info. is really helpful and now i can proceed on finding more related matter on this.

spooon 09-22-2005 12:52 AM

If you use SSH with X forwarding, then you shouldn't set the DISPLAY variable. If you manually set the display, and then the programs communicate directly to your X server across the insecure network, then that defeats the whole point of X forwarding (you are not forwarding at all).

If you tell SSH to X forward (e.g. with the -Y or -X option), the SSH will set it up so that programs communicate to port on the local machine, and then SSH will *forward* that to your computer.

nabeelmoidu 09-22-2005 01:20 AM

Check out this
http://www.xfree86.org/current/X.7.html


All times are GMT -5. The time now is 05:31 PM.