nlkabilan
09-12-2006, 07:12 AM
How to get the 'DISPLAY variable' information from the users who have logged in to the server.
|
Click to See Complete Forum and Search --> : How to Find Environment variable 'DISPLAY' of an user nlkabilan 09-12-2006, 07:12 AM How to get the 'DISPLAY variable' information from the users who have logged in to the server. je_fro 09-12-2006, 07:40 AM echo $DISPLAY voidinit 09-13-2006, 01:55 AM If you only need to get your DISPLAY environment variable, then echo $DISPLAY will work. However, it sounds like you are trying to show the DISPLAY environment variables from several users in seperate shells that are either VNCing or exporting X sessions or whatever. Echoing $DISPLAY in your own shell would naturally only show you your shell's display variable. You can't really attach to another user's shell and execute arbitrary commands like "echo $DISPLAY". People usually call that behavior an "exploit" for some reason. If you just want to know which display number is being used by which user, write a script that look's at X's unix domain sockets, and prints who owns them. They are usually in /tmp/.X11-unix/Xn where n is the display number. If you want more detailed information about what is being set as the environment variable itself, have X's startup scripts log the variable to a central file as the user's X session starts (i.e. look at adding something to xinitrc). If using VNC, write a shell script wrapper around vncserver that will do the same. justlinux.com
Copyright Internet.com Inc. All Rights Reserved. |