Sample Header Ad - 728x90

Why tilde (~) doesn't expand when used with CLI argument starting with dash?

14 votes
1 answer
2359 views
I lost a couple of hours trying to run VNC server (x0vncserver) and the client refused to connect with weird message that No password configured for VNC Auth The server also prints this error SVncAuth: opening password file '~/.vnc/passwd' failed Ok, I wasted a lot of time until I realized the tilde was neither expanded by the shell, nor by x0vncserver. Then I ran these tests $ echo --PasswordFile=~/.vnc/passwd --PasswordFile=~/.vnc/passwd But $ echo PasswordFile=~/.vnc/passwd PasswordFile=/home/tichomir/.vnc/passwd Why is that? Why the shell refuses to expand tilde if the argument begins with a dash? I thought tilde will always expand as long as it is not quoted, but apparently there is another rule that comes into play?
Asked by Tihomir Mitkov (393 rep)
Feb 3, 2019, 10:04 AM
Last activity: Feb 3, 2019, 05:33 PM