delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/02/14/18:50:57

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type; q=dns; s=default; b=ROYP
DsOv7LGNCmbqJEqNGk7iFtvuP2BzkFfRo7sXqXfCDZ88wK0A5n+GY4vOcYov5Zzi
L3bM3OM07PjrZ/N4Rilvje+sA5oL1mIIXDPCzo1M3VVQ6tXQrUHA47Owoj/3VCJu
BeluNgYOZReXjD4eEz5zEzRMKz8uJKhq93jz2Bk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type; s=default; bh=qd3/wFxd72
dIh1EIE2DHlaOJde8=; b=lb17ZvkhCHHL94qCoNrMpfwiTSEHdYjMRRGfMtFMcy
NS0m158zjc6ZLiQ/MSuYrLNlWEyDVI1MUNy6IFaPoR/GR+nw4VdkigZ/2A8jplDQ
1OU/skEMNtLGqviWYv782v8gGbgzkNnSJohCh+10Ya56qAmFhl4EIGvvqBOf6s+E
w=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=UD:faq.html, faq.html, faqhtml, assigns
X-HELO: mx1.redhat.com
Subject: Re: Get Cygwin home directory path for current user
To: cygwin AT cygwin DOT com
References: <CANV9t=R83dQddZOVWVUg55t7K=DUyE8BiQ10Pn1v4G+xcgPh3w AT mail DOT gmail DOT com> <9539a1e8-e893-3175-f96c-fb4ad172702c AT redhat DOT com> <CANV9t=R-1XE-cyKa5vtvtu_3dJiYoLRstBTN86JiQ2FS2T+Jyw AT mail DOT gmail DOT com> <2a87c6c0-6a0f-6994-3620-8b0b722d7d49 AT redhat DOT com> <CANV9t=QXVTGF0uS+vNCmkrxNOV7GVAsO_5hTS9hizX0tnW=-PA AT mail DOT gmail DOT com> <06CBB893-FD9F-460F-B00C-E22950036B5E AT solidrocksystems DOT com> <CANV9t=RML1q=ZAQOadvrsjmWn2391s6jr_t1MgbaJxO6DM2V5Q AT mail DOT gmail DOT com>
From: Eric Blake <eblake AT redhat DOT com>
Openpgp: preference=signencrypt
Message-ID: <d96ca424-64ab-0b26-baed-e1b6d18bc122@redhat.com>
Date: Thu, 14 Feb 2019 17:50:41 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0
MIME-Version: 1.0
In-Reply-To: <CANV9t=RML1q=ZAQOadvrsjmWn2391s6jr_t1MgbaJxO6DM2V5Q@mail.gmail.com>
X-IsSubscribed: yes

--InWEyg4ml68UmhwGHhGBIL3Cie0BylH5T
Content-Type: multipart/mixed; boundary="tLaaGxtPmkYAaJqkfXzsM5bMF5WXy03rh";
 protected-headers="v1"
From: Eric Blake <eblake AT redhat DOT com>
To: cygwin AT cygwin DOT com
Message-ID: <d96ca424-64ab-0b26-baed-e1b6d18bc122 AT redhat DOT com>
Subject: Re: Get Cygwin home directory path for current user
References: <CANV9t=R83dQddZOVWVUg55t7K=DUyE8BiQ10Pn1v4G+xcgPh3w AT mail DOT gmail DOT com>
 <9539a1e8-e893-3175-f96c-fb4ad172702c AT redhat DOT com>
 <CANV9t=R-1XE-cyKa5vtvtu_3dJiYoLRstBTN86JiQ2FS2T+Jyw AT mail DOT gmail DOT com>
 <2a87c6c0-6a0f-6994-3620-8b0b722d7d49 AT redhat DOT com>
 <CANV9t=QXVTGF0uS+vNCmkrxNOV7GVAsO_5hTS9hizX0tnW=-PA AT mail DOT gmail DOT com>
 <06CBB893-FD9F-460F-B00C-E22950036B5E AT solidrocksystems DOT com>
 <CANV9t=RML1q=ZAQOadvrsjmWn2391s6jr_t1MgbaJxO6DM2V5Q AT mail DOT gmail DOT com>
In-Reply-To: <CANV9t=RML1q=ZAQOadvrsjmWn2391s6jr_t1MgbaJxO6DM2V5Q AT mail DOT gmail DOT com>


--tLaaGxtPmkYAaJqkfXzsM5bMF5WXy03rh
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 2/14/19 4:52 PM, Bill Stewart wrote:

> So I guess I have a feature request:
>=20
> 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 value of $HOME that Cygwin would assign. (The fact that
a cygwin shell would expand ~ into the contents of $HOME is a side
point; if you can access the correct $HOME, then you don't need a cygwin
shell to tilde-expand ~ into $HOME).

But wait - let's see how Cygwin assigns $HOME in the first place:

https://cygwin.com/faq.html#faq.setup.home

If $HOME is set in your Windows environment, then that's the $HOME that
Cygwin will use.  In which case, 'cygpath -aw $HOME' from PowerShell
should return the same thing as 'dash -c 'cygpath -aw $HOME'' from
PowerShell.

But if $HOME is not set in your Windows environment, then you have a
point that any Cygwin process will see HOME set to whatever 'getent
passwd' would display, while PowerShell would not see a $HOME variable
set at all. So you DO have a point that an additional option to cygpath
to compute and display $HOME may be useful.

Are you going to write and submit the patch?  Because it's not my itch,
I do not plan to be the one to write such a patch.

--=20
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


--tLaaGxtPmkYAaJqkfXzsM5bMF5WXy03rh--

--InWEyg4ml68UmhwGHhGBIL3Cie0BylH5T
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlxl/tIACgkQp6FrSiUn
Q2pGBAf/UU7Ylqgn/Op1caRzQZ6uXU1N+TiY0KRO/6lSnAWWUbnLXGGWbfkLvRo3
ozG2TDCIIfl66snbmE81XfpKw0QLx12GoKkpssJO8SoyO9P7EHSfdzRsiL7GE24m
yzqOIKHKvwGzmhfvEmuDuBaWcrFHcyektalmkzmfxyDIK6faZ3Iq8MaEzNQqzn/d
Hr90kIPJhkrfPxuUCXUBwaqp9LptLdTYiBNwo3hQJlq5CxyJ5Xts3pUvMPISQFpS
iiwBi0Evwrx/6dcsK7vdTtA/1tTQRgLc5BZhk1ynPwfOU9+8LDyx/fj3H1+y2IfE
uATp6JVBKd4RtDKYq0p52UxMvBOPEg==
=Liwj
-----END PGP SIGNATURE-----

--InWEyg4ml68UmhwGHhGBIL3Cie0BylH5T--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019