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

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:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=M23SHve
7TVFXDl9KONv1zSF3cpu1du3i6I28XO9wKiLaKhXnWwzsuZoXkATbo8JImqRuoVg
/1XktTTqobAxBs0Abdn3WG4eMweiaXK+wPKWIqZPbQ46fUSbwomIlviuZSTMdYM3
Ei3VO32Ke/Orgp3FlzkXcZMy8Dgkgbs/0FHA=
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:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; s=default; bh=V3ql9Zxtd3Apf
oQSX0/jcs7ImAA=; b=my1n/ZByfFVxbJdINXKLn4l3lkK8IBSvo+m8AseSXD9l+
T+Dg3xLLQR8t7OGFjam8KwDyclzE8SFu60wmfQL9YBIOXR6eWG+FdkvQ7IHApYZk
MDoybVXrhVIuiXiz9KKr/Onr3i1c6iWPLbjI8ZDkh2UpxVXFb8X3ehpmjfSlbs=
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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=prerequisite
X-HELO: mout.gmx.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.com; s=dbd5af2cbaf7; t=1550184756; bh=hyokd28czcTMsPB7Lz6Kf7CO2Mh+6vw4j0VSDqxirRQ=; h=X-UI-Sender-Class:References:In-Reply-To:From:Date:Subject:To; b=4ttWE4EmIL1R8ueTslmTrAaY7QxNjH6SZLys2nAT8HitC1OAUDnuNqSernCpKS/ZJ 67sRA1r8R3VL+cdsXkUnG6KdoisM2JRpycilhpMNNiqtDG41NHGrB5A/X/M35QYeBv j190qB7O5pxS89LsawX2Sf0zYrOiURW6mph7ih40=
X-UI-Sender-Class: 214d933f-fd2f-45c7-a636-f5d79ae31a79
MIME-Version: 1.0
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>
In-Reply-To: <06CBB893-FD9F-460F-B00C-E22950036B5E@solidrocksystems.com>
From: Bill Stewart <bstewart AT iname DOT com>
Date: Thu, 14 Feb 2019 15:52:22 -0700
Message-ID: <CANV9t=RML1q=ZAQOadvrsjmWn2391s6jr_t1MgbaJxO6DM2V5Q@mail.gmail.com>
Subject: Re: Get Cygwin home directory path for current user
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

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

- Raw text -


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