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=qUq2PuY QFqYQna4VzJVsjCDqNFvX0bwmG6gFcHLhsTSGydwZBvOJmkUZKdsvjnZe13KhUeT dLu0DuluLliVBo9saQq3xTGh0nUixC9bwEyQkla0GVuI0tAg4JQyBJAbe0E2+H6M BbmR2NyxTwPcAMVWjfVywpm+10jX5gitanew= 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=o4wTX9sx4RJTp 5X67t/DQmTQwbQ=; b=xweKqbQaIxTYgFKAES1twV+lXyvFS09T3GXkT5WvmObUj x4gQx38PUlre4ZYogRN1lVEUlYKQX/8dS8EUr9+2uI5OOwb1OH/HCtjDcYvTyOWu yogzHiUyO7hbbTDhuu7/0ZiGoc1KS0cWueOMW4iiEZIymCJNJwOBufPcP8D58o= 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=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mout.gmx.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.com; s=dbd5af2cbaf7; t=1550258826; bh=IZd1tkyDmsSA0ZrOYqFPKwJGzqEM7d0rMuwa4blQgDo=; h=X-UI-Sender-Class:References:In-Reply-To:From:Date:Subject:To; b=cuG+OkGyI85bsc1wM7PEG3S86bHoY5Hd3t5vn/mJvyTMoX9zR6QfOglpl8GbLyicG 709tCkKLvwKnbX1eUIkpXgqInVCR38gGOTC5Vd6V4F84pHz6OjV32r/A414veMjpW3 aLHjQDLsIarHVSfuy7Nx8sQp3EG3ccX05NrkGm5Q= X-UI-Sender-Class: 214d933f-fd2f-45c7-a636-f5d79ae31a79 MIME-Version: 1.0 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> <20190216011444 DOT c1303c92d2cd9af253b3e0d9 AT nifty DOT ne DOT jp> In-Reply-To: <20190216011444.c1303c92d2cd9af253b3e0d9@nifty.ne.jp> From: Bill Stewart Date: Fri, 15 Feb 2019 12:26:51 -0700 Message-ID: Subject: Re: Get Cygwin home directory path for current user To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes 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 PowerShell? All you need is cygpath -w ((getent passwd $Env:USERNAME) -split ':')[5] We're still forced to spawn two executables, but at least we're not dependent on a Cygwin shell expansion so this is probably a bit better. Regards, 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