Re: Get Cygwin home directory path for current user

2019-02-19 Thread Bill Stewart
On Fri, Feb 15, 2019 at 11:09 PM L A Walsh wrote: > Vince, I think What Bill is trying to ask is how does > the cygwin shell might do it (answer: look at the source! ;-)). Or rather more succinctly: "Cygwin, what is the path to the current user's home directory?" IMO it would be simpler for

Re: Get Cygwin home directory path for current user

2019-02-15 Thread L A Walsh
On 2/14/2019 3:57 PM, Vince Rice wrote: >> On Feb 14, 2019, at 5:41 PM, Bill Stewart wrote: >> >> (?) I understand that the shell does ~ expansion >> > > It would not appear that you do. You asked why a Cygwin shell would be a > prerequisite. > Vince, I think What Bill is

Re: Get Cygwin home directory path for current user

2019-02-15 Thread Andrey Repin
Greetings, Doug Henderson! >> >> Greetings, Bill Stewart! >> >> >> Setup your system to use %USERPROFILE% as $HOME and forget this problem >> >> altogether. >> >> For interoperability's sake! (q) >> >> > That won't work, because Cygwin $HOME can be different from the >> > USERPROFILE environment v

Re: Get Cygwin home directory path for current user

2019-02-15 Thread Doug Henderson
On Fri, 15 Feb 2019 at 13:35, Andrey Repin wrote: > > Greetings, Bill Stewart! > > >> Setup your system to use %USERPROFILE% as $HOME and forget this problem > >> altogether. > >> For interoperability's sake! (q) > > > That won't work, because Cygwin $HOME can be different from the > > USERPROFILE

Re: Get Cygwin home directory path for current user

2019-02-15 Thread Andrey Repin
Greetings, Bill Stewart! >> Setup your system to use %USERPROFILE% as $HOME and forget this problem >> altogether. >> For interoperability's sake! (q) > That won't work, because Cygwin $HOME can be different from the > USERPROFILE environment variable on Windows. Make. It. The. Same. Tell, don't

Re: Get Cygwin home directory path for current user

2019-02-15 Thread Bill Stewart
On Fri, Feb 15, 2019 at 4:50 AM Andrey Repin wrote: > Not as good as bash. Just so you know. We'll just agree to disagree on that (particularly on Windows). > Setup your system to use %USERPROFILE% as $HOME and forget this problem > altogether. > For interoperability's sake! (q) That won't work

Re: Get Cygwin home directory path for current user

2019-02-15 Thread Bill Stewart
On Fri, Feb 15, 2019 at 9:14 AM Takashi Yano wrote: > If you don't want to use "shell", you can: > c:/cygwin/bin/cygpath -w $(c:/cygwin/bin/getent passwd $env:USERNAME | > c:/cygwin/bin/cut -d: -f6) > but I'm not sure if you think this is "awkward" as well. Why cut if you are already using Power

Re: Get Cygwin home directory path for current user

2019-02-15 Thread Brian Inglis
On 2019-02-14 17:03, Bill Stewart wrote: > On Thu, Feb 14, 2019 at 4:57 PM Vince Rice wrote: >> Here, you say "forget about the ~ character." We can't "forget" about the >> tilde. This whole >> conversation is about the tilde, specifically tilde expansion. > Eric Blake seems to have understood (se

Re: Get Cygwin home directory path for current user

2019-02-15 Thread Takashi Yano
On Thu, 14 Feb 2019 16:41:11 -0700 Bill Stewart wrote: > (?) I understand that the shell does ~ expansion. I am asking for a > way to get that particular path (forget about the ~ character for the > time being) without needing to invoke a Cygwin shell in the first > place. (That was the whole point

Re: Get Cygwin home directory path for current user

2019-02-15 Thread Andrey Repin
Greetings, Bill Stewart! >> 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

Re: Get Cygwin home directory path for current user

2019-02-14 Thread LRN
On 15.02.2019 2:41, Bill Stewart wrote: > On Thu, Feb 14, 2019 at 4:32 PM Vince Rice wrote: > >> I didn't suggest everyone did. But people who want tilde expansion do, >> because it's >> the shell that is responsible for tilde expansion. >> ... >> No, it isn't "oddly" absent. As has been said rep

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Bill Stewart
On Thu, Feb 14, 2019 at 4:57 PM Vince Rice wrote: > Here, you say "forget about the ~ character." We can't "forget" about the > tilde. This whole > conversation is about the tilde, specifically tilde expansion. Eric Blake seems to have understood (see his response if it's still unclear). Regard

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Vince Rice
> On Feb 14, 2019, at 5:41 PM, Bill Stewart wrote: > > On Thu, Feb 14, 2019 at 4:32 PM Vince Rice wrote: > >> I didn't suggest everyone did. But people who want tilde expansion do, >> because it's >> the shell that is responsible for tilde expansion. >> ... >> No, it isn't "oddly" absent. As has

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Eric Blake
On 2/14/19 4:52 PM, Bill Stewart wrote: > 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). Let's phrase that more accurately. You want a new option to cygpath that would return the va

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Bill Stewart
On Thu, Feb 14, 2019 at 4:32 PM Vince Rice wrote: > I didn't suggest everyone did. But people who want tilde expansion do, > because it's > the shell that is responsible for tilde expansion. > ... > No, it isn't "oddly" absent. As has been said repeatedly in this thread, > tilde expansion > is t

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Vince Rice
> On Feb 14, 2019, at 4:52 PM, Bill Stewart wrote: > > 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.

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Bill Stewart
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

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Vince Rice
> On Feb 14, 2019, at 3:51 PM, Bill Stewart wrote: > > Seems like there must be a better way... 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. -- Problem reports: http

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Bill Stewart
On Thu, Feb 14, 2019 at 2:15 PM Eric Blake wrote: > If you want tilde-expansion to happen, you have to use a shell that does > tilde-expansion. bash and dash do, PowerShell does not. It is not > cygpath's fault, but your choice of shell, that determines whether ~ is > expanded. And, since the ti

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Eric Blake
On 2/14/19 2:22 PM, Bill Stewart wrote: > 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

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Bill Stewart
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

Re: Get Cygwin home directory path for current user

2019-02-14 Thread Eric Blake
On 2/14/19 1:40 PM, Bill Stewart wrote: > According to this: > > https://stackoverflow.com/questions/42841907/ > > cygpath -w ~ > > ...formerly produced to stdout the home directory path for the current user. > > This seems not be the case any more: When I run cygpath -w ~, I get just ~. What

Get Cygwin home directory path for current user

2019-02-14 Thread Bill Stewart
According to this: https://stackoverflow.com/questions/42841907/ cygpath -w ~ ...formerly produced to stdout the home directory path for the current user. This seems not be the case any more: When I run cygpath -w ~, I get just ~. Is this by design? If so, what's the way to programmatically de