For some reason tilde expansion in Cygwin is not working for me at the prompt:
$ ls ~
ls: cannot access : No such file or directory
$ ls ~/bin
(lists /bin not $HOME/bin)
$ echo $HOME
/home/myusername
$ echo ~
$
In the last case there (echo ~) there is no output (other than a couple of blank lines.)
I have set expand-tilde on set in my $HOME/.inputrc file. Is there something else I need configured?
This is a recurring problem with Cygwin that, I believe, was tied to some upgrade bug a while ago and never resolved.
In any case, the solution is simple: open
/etc/passwdin your favourite editor, and on the line with your username, between the fifth and sixth colons (the last and second-to-last), write in the correct path to your home directory, ie/home/myusername.The relevant line in my
/etc/passwdlooks something like the below: