-1

I'm doing some work using Linux server, after I log on to the server,the tutorial says:

If you need to run any program which will open a window, like xterm, from these servers, you need to set display first.

To do that, I need to execute setenv DISPLAY name:portnum.What does this command really do?If I don't execute this command,what will happen?And what is xterm?

Yuan Wen
  • 1,583
  • 3
  • 20
  • 38

3 Answers3

2

setenv is specific and peculiar to csh and derivatives. The modern portable syntax is

DISPLAY=:0.0

though if your shell is csh or tcsh, this will not work, and you do need setenv after all.

Depending on the use case, you may need to export DISPLAY as well.

Environment variables are a simple way to pass configuration information between programs. The DISPLAY variable indicates to graphical programs on which screen or graphical terminal to display their GUI.

tripleee
  • 175,061
  • 34
  • 275
  • 318
  • See updated answer; but really, yours are simple beginner questions about computer usage which don't belong on Stack Overflow, which is for programming-related questions. Maybe flag your question for moderator attention and request migration to our sister site [unix.se]; though check their posting guidelines first. – tripleee Jul 25 '16 at 10:55
1

For X Window System, it is a server/client architecture, usually, server side is called display, the tutorials means you should launch server side and specify launch parameter for server side.

read here for more details.

gzh
  • 3,507
  • 2
  • 19
  • 23
0

Xterm is just a terminal. And setenv, is used to set Environment variables, which are basically variables used to define the behavior of the terminal. For example, you have the variable PATH, which is used by the terminal to find the path where to execute binaries. Because if you type the command "ls", your terminal has to go into the "env", look for the variable "PATH", and use the value stored in this variable "PATH" to find the path of the ls binary. But I don't know if it's necessary in your situation, could you give more details about the context?

souki
  • 1,305
  • 4
  • 23
  • 39