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: List-Subscribe: List-Archive: List-Post: List-Help: , 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: <9539a1e8-e893-3175-f96c-fb4ad172702c AT redhat DOT com> <2a87c6c0-6a0f-6994-3620-8b0b722d7d49 AT redhat DOT com> <06CBB893-FD9F-460F-B00C-E22950036B5E AT solidrocksystems DOT com> From: Eric Blake Openpgp: preference=signencrypt Message-ID: 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: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="InWEyg4ml68UmhwGHhGBIL3Cie0BylH5T" X-IsSubscribed: yes --InWEyg4ml68UmhwGHhGBIL3Cie0BylH5T Content-Type: multipart/mixed; boundary="tLaaGxtPmkYAaJqkfXzsM5bMF5WXy03rh"; protected-headers="v1" From: Eric Blake To: cygwin AT cygwin DOT com Message-ID: Subject: Re: Get Cygwin home directory path for current user References: <9539a1e8-e893-3175-f96c-fb4ad172702c AT redhat DOT com> <2a87c6c0-6a0f-6994-3620-8b0b722d7d49 AT redhat DOT com> <06CBB893-FD9F-460F-B00C-E22950036B5E AT solidrocksystems DOT com> In-Reply-To: --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--