Web lists-archives.com

Re: Get Cygwin home directory path for current user




On Thu, Feb 14, 2019 at 3:14 PM Vince Rice wrote:

> There is -- use a cygwin shell. As Eric has already explained, expansion is the
> shell's responsibility. Powershell doesn't do it. If you want expansion, use one
> that does.

So let's consider, for a bit, that not everybody uses a Cygwin shell.
(Hard to believe, perhaps, but PowerShell is really quite good.)

For interoperability's sake, it is useful to get this path from the
Windows side, and this seems oddly absent.

Cygpath already has a set of flags for returning system information
directories, such as -H, which returns the path to the user profile
directory. (As I noted previously, this is not always the same as ~
when expanded in a Cygwin shell.)

Ergo: It would be quite useful if cygpath could tell us this path directly.

As I noted previously, yes, the below works:

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

However, this seems awkward and requires a Cygwin shell (why should
that be a prerequisite?).

So I guess I have a feature request:

Add a new flag to cygpath that returns the current user's home
directory (same as what ~ returns from a Cygwin 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