Get Cygwin home directory path for current user

Bill Stewart bstewart@iname.com
Thu Feb 14 20:48:00 GMT 2019


On Thu, Feb 14, 2019 at 12:49 PM Eric Blake wrote:

> Depending on the shell, ~ is expanded to $HOME prior to invoking a
> program. But if you want to take the shell's expansions out of the
> equation, you could use:
>
> cygpath -w "$HOME"

Ah. I'm not using a Cygwin shell (PowerShell actually). So the
expansion happens before cygpath sees it, which is why it works in a
Cygwin shell but not directly from Windows...

So therefore I can write

dash -c '/bin/cygpath -w ~'

To get it, but this seems a bit roundabout and awkward.

Is there any way to do it more directly from a Windows shell?

Thanks!

Bill

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list