Skip to content

Conversation

@tyilo
Copy link

@tyilo tyilo commented Jul 16, 2019

The file /tmp/.X0-lock doesn't exist even though I have a display 0.
However the file /tmp/.X11-unix/X0 exists instead.

The file `/tmp/.X0-lock` doesn't exist even though I have a display 0.
However the file `/tmp/.X11-unix/X0` exists instead.
@J4MMlE
Copy link

J4MMlE commented Jan 31, 2023

Because /tmp/.X11-unix/X_ is a socket file, testing for its existence with the -f flag (which tests for regular files) does not work. Either -S (true if file exists and is a socket) or the more generic -e (which tests only for file existence regardless of its type) should be used. Check Bash Conditional Expressions for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants