LX0-104 · Question #486
Which of the following lines is an example of a correct setting for the DISPLAY environment variable?
The correct answer is B. hostname:displaynumber. The DISPLAY environment variable specifies the X server to connect to, using a format that includes the hostname and display number.
Question
Options
- Ahostname:displayname
- Bhostname:displaynumber
- Chostname/displayname
- Dhostname/displaynumber
- Ehostname
How the community answered
(54 responses)- A2% (1)
- B94% (51)
- C4% (2)
Why each option
The DISPLAY environment variable specifies the X server to connect to, using a format that includes the hostname and display number.
displayname is not the standard term for the numeric identifier of a display; it should be a number.
The correct format for the DISPLAY environment variable is [hostname]:display_number[.screen_number]. hostname:displaynumber accurately represents a valid setting, where display_number identifies a specific display on the host, typically starting from 0.
The / character is not used as a separator in the DISPLAY variable; a colon : is used.
The / character is not used as a separator in the DISPLAY variable; a colon : is used.
Simply providing a hostname is insufficient as it does not explicitly specify which display on that host to use, though it might implicitly default to display 0.
Concept tested: X Window System DISPLAY variable
Source: https://www.x.org/releases/X11R7.6/doc/man/man7/X.7.html
Topics
Community Discussion
No community discussion yet for this question.